Skip to content

Commit

Permalink
fix: use shorthand syntax in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
SGSSGene committed Mar 11, 2024
1 parent 3c63481 commit 9ed3146
Showing 1 changed file with 4 additions and 22 deletions.
26 changes: 4 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -397,12 +397,7 @@ CPMAddPackage("gh:jbeder/yaml-cpp#yaml-cpp-0.6.3@0.6.3")
### [nlohmann/json](https://github.com/nlohmann/json)

```cmake
CPMAddPackage(
NAME nlohmann_json
VERSION 3.9.1
GITHUB_REPOSITORY nlohmann/json
OPTIONS
"JSON_BuildTests OFF"
CPMAddPackage("gh:nlohmann/json@3.9.1" OPTIONS "JSON_BuildTests OFF")
)
```

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

```cmake
# the install option has to be explicitly set to allow installation
CPMAddPackage(
GITHUB_REPOSITORY jarro2783/cxxopts
VERSION 2.2.1
OPTIONS "CXXOPTS_BUILD_EXAMPLES NO" "CXXOPTS_BUILD_TESTS NO" "CXXOPTS_ENABLE_INSTALL YES"
CPMAddPackage("gh:jarro2783/cxxopts@2.2.1" OPTIONS "CXXOPTS_BUILD_EXAMPLES NO" "CXXOPTS_BUILD_TESTS NO" "CXXOPTS_ENABLE_INSTALL YES"
)
```

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

```cmake
CPMAddPackage(
NAME benchmark
GITHUB_REPOSITORY google/benchmark
VERSION 1.5.2
OPTIONS "BENCHMARK_ENABLE_TESTING Off"
)
CPMAddPackage("gh:google/benchmark@1.5.2" OPTIONS "BENCHMARK_ENABLE_TESTING Off")
if(benchmark_ADDED)
# enable c++11 to avoid compilation errors
Expand All @@ -457,12 +444,7 @@ endif()
### [Lua](https://www.lua.org)

```cmake
CPMAddPackage(
NAME lua
GIT_REPOSITORY https://github.com/lua/lua.git
VERSION 5.3.5
DOWNLOAD_ONLY YES
)
CPMAddPackage("gh:lua/lua@5.3.5" DOWNLOAD_ONLY YES)
if (lua_ADDED)
# lua has no CMake support, so we create our own target
Expand Down

0 comments on commit 9ed3146

Please sign in to comment.