Skip to content

Commit 26478df

Browse files
committed
doc: extend README mentioning shorthand syntax with options
1 parent 3c5b33a commit 26478df

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ If an additional optional parameter `SYSTEM` is set to a truthy value, the SYSTE
8484
See the [add_subdirectory ](https://cmake.org/cmake/help/latest/command/add_subdirectory.html?highlight=add_subdirectory)
8585
and [SYSTEM](https://cmake.org/cmake/help/latest/prop_tgt/SYSTEM.html#prop_tgt:SYSTEM) target property for details.
8686

87-
A single-argument compact syntax is also supported:
87+
A shorthand syntax is also supported:
8888

8989
```cmake
9090
# A git package from a given uri with a version
@@ -108,6 +108,13 @@ CPMAddPackage("https://example.com/my-package-1.2.3.zip#MD5=68e20f674a48be38d60e
108108
CPMAddPackage("https://example.com/my-package.zip@1.2.3")
109109
```
110110

111+
Additionally, the shorthand syntax can be combined with the other options from above:
112+
```cmake
113+
CPMAddPackage("gh:nlohmann/json@3.9.1"
114+
OPTIONS "JSON_BuildTests OFF"
115+
)
116+
```
117+
111118
After calling `CPMAddPackage`, the following variables are defined in the local scope, where `<dependency>` is the name of the dependency.
112119

113120
- `<dependency>_SOURCE_DIR` is the path to the source of the dependency.

0 commit comments

Comments
 (0)