Skip to content

Commit 4eaa26b

Browse files
committed
fix: use shorthand syntax in examples
1 parent 00ff943 commit 4eaa26b

File tree

1 file changed

+4
-22
lines changed

1 file changed

+4
-22
lines changed

README.md

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -397,12 +397,7 @@ CPMAddPackage("gh:jbeder/yaml-cpp#yaml-cpp-0.6.3@0.6.3")
397397
### [nlohmann/json](https://github.com/nlohmann/json)
398398

399399
```cmake
400-
CPMAddPackage(
401-
NAME nlohmann_json
402-
VERSION 3.9.1
403-
GITHUB_REPOSITORY nlohmann/json
404-
OPTIONS
405-
"JSON_BuildTests OFF"
400+
CPMAddPackage("gh:nlohmann/json@3.9.1" OPTIONS "JSON_BuildTests OFF")
406401
)
407402
```
408403

@@ -431,22 +426,14 @@ For a working example of using CPM to download and configure the Boost C++ Libra
431426

432427
```cmake
433428
# the install option has to be explicitly set to allow installation
434-
CPMAddPackage(
435-
GITHUB_REPOSITORY jarro2783/cxxopts
436-
VERSION 2.2.1
437-
OPTIONS "CXXOPTS_BUILD_EXAMPLES NO" "CXXOPTS_BUILD_TESTS NO" "CXXOPTS_ENABLE_INSTALL YES"
429+
CPMAddPackage("gh:jarro2783/cxxopts@2.2.1" OPTIONS "CXXOPTS_BUILD_EXAMPLES NO" "CXXOPTS_BUILD_TESTS NO" "CXXOPTS_ENABLE_INSTALL YES"
438430
)
439431
```
440432

441433
### [google/benchmark](https://github.com/google/benchmark)
442434

443435
```cmake
444-
CPMAddPackage(
445-
NAME benchmark
446-
GITHUB_REPOSITORY google/benchmark
447-
VERSION 1.5.2
448-
OPTIONS "BENCHMARK_ENABLE_TESTING Off"
449-
)
436+
CPMAddPackage("gh:google/benchmark@1.5.2" OPTIONS "BENCHMARK_ENABLE_TESTING Off")
450437
451438
if(benchmark_ADDED)
452439
# enable c++11 to avoid compilation errors
@@ -457,12 +444,7 @@ endif()
457444
### [Lua](https://www.lua.org)
458445

459446
```cmake
460-
CPMAddPackage(
461-
NAME lua
462-
GIT_REPOSITORY https://github.com/lua/lua.git
463-
VERSION 5.3.5
464-
DOWNLOAD_ONLY YES
465-
)
447+
CPMAddPackage("gh:lua/lua@5.3.5" DOWNLOAD_ONLY YES)
466448
467449
if (lua_ADDED)
468450
# lua has no CMake support, so we create our own target

0 commit comments

Comments
 (0)