-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: extend README mentioning shorthand syntax with options
- Loading branch information
Showing
1 changed file
with
8 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,7 +87,7 @@ If an additional optional parameter `SYSTEM` is set to a truthy value, the SYSTE | |
See the [add_subdirectory ](https://cmake.org/cmake/help/latest/command/add_subdirectory.html?highlight=add_subdirectory) | ||
and [SYSTEM](https://cmake.org/cmake/help/latest/prop_tgt/SYSTEM.html#prop_tgt:SYSTEM) target property for details. | ||
|
||
A single-argument compact syntax is also supported: | ||
A shorthand syntax is also supported: | ||
|
||
```cmake | ||
# A git package from a given uri with a version | ||
|
@@ -111,6 +111,13 @@ CPMAddPackage("https://example.com/my-package-1.2.3.zip#MD5=68e20f674a48be38d60e | |
CPMAddPackage("https://example.com/[email protected]") | ||
``` | ||
|
||
Additionally, the shorthand syntax can be combined with the other options from above: | ||
```cmake | ||
CPMAddPackage("gh:nlohmann/[email protected]" | ||
OPTIONS "JSON_BuildTests OFF" | ||
) | ||
``` | ||
|
||
After calling `CPMAddPackage`, the following variables are defined in the local scope, where `<dependency>` is the name of the dependency. | ||
|
||
- `<dependency>_SOURCE_DIR` is the path to the source of the dependency. | ||
|