Skip to content

Commit 668fb00

Browse files
committed
doc: extend README mentioning shorthand syntax with options
1 parent 7fbb9cd commit 668fb00

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
@@ -87,7 +87,7 @@ If an additional optional parameter `SYSTEM` is set to a truthy value, the SYSTE
8787
See the [add_subdirectory ](https://cmake.org/cmake/help/latest/command/add_subdirectory.html?highlight=add_subdirectory)
8888
and [SYSTEM](https://cmake.org/cmake/help/latest/prop_tgt/SYSTEM.html#prop_tgt:SYSTEM) target property for details.
8989

90-
A single-argument compact syntax is also supported:
90+
A shorthand syntax is also supported:
9191

9292
```cmake
9393
# 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
111111
CPMAddPackage("https://example.com/my-package.zip@1.2.3")
112112
```
113113

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

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

0 commit comments

Comments
 (0)