Commit 0cc8806ec53db1d89834a52d6665069f171d09a3

Authored by Henry Schreiner
Committed by Henry Schreiner
1 parent a08e25ea

fixup! CMake updates from @slurps-mad-rips

CMakeLists.txt
... ... @@ -46,7 +46,7 @@ list(APPEND force-libcxx "CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME")
46 46 list(APPEND build-docs "CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME")
47 47 list(APPEND build-docs "NOT CMAKE_VERSION VERSION_LESS 3.11")
48 48 list(APPEND build-docs "Doxygen_FOUND")
49   -list(APPEND build-docs "EXISTS docs")
  49 +list(APPEND build-docs "EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/docs")
50 50  
51 51 option(CLI11_WARNINGS_AS_ERRORS "Turn all warnings into errors (for CI)")
52 52 option(CLI11_SINGLE_FILE "Generate a single header file")
... ... @@ -64,7 +64,7 @@ cmake_dependent_option(CLI11_BUILD_TESTS
64 64  
65 65 cmake_dependent_option(CLI11_BUILD_EXAMPLES
66 66 "Build CLI11 examples" ON
67   - "CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME;EXISTS examples" OFF)
  67 + "CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME;EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/examples" OFF)
68 68  
69 69 cmake_dependent_option(CLI11_BUILD_EXAMPLES_JSON
70 70 "Build CLI11 json example" OFF
... ... @@ -267,7 +267,7 @@ if(CLI11_BUILD_DOCS)
267 267 endif()
268 268  
269 269 # From a build system, this might not be included.
270   -if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND EXISTS book)
  270 +if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/book")
271 271 add_subdirectory(book)
272 272 endif()
273 273  
... ...
examples/CMakeLists.txt
... ... @@ -12,10 +12,12 @@ function(add_cli_exe T)
12 12 endfunction()
13 13  
14 14 if(CLI11_BUILD_EXAMPLES_JSON)
  15 + message(STATUS "Using nlohmann/json")
15 16 FetchContent_Declare(json
16   - GIT_REPOSITORY https://github.com/nlohmann/json.git
17   - GIT_SHALLOW 1
18   - GIT_TAG v3.7.3)
  17 + URL https://github.com/nlohmann/json/releases/download/v3.7.3/include.zip
  18 + URL_HASH "SHA256=87b5884741427220d3a33df1363ae0e8b898099fbc59f1c451113f6732891014"
  19 + )
  20 +
19 21 FetchContent_GetProperties(json)
20 22 if (NOT json_POPULATED)
21 23 FetchContent_Populate(json)
... ...
tests/CMakeLists.txt
... ... @@ -6,6 +6,7 @@ endif()
6 6 list(APPEND CMAKE_MODULE_PATH "${CLI11_SOURCE_DIR}/cmake")
7 7  
8 8 if(CLI11_SANITIZERS)
  9 + message(STATUS "Using arsenm/sanitizers-cmake")
9 10 FetchContent_Declare(sanitizers
10 11 GIT_REPOSITORY https://github.com/arsenm/sanitizers-cmake.git
11 12 GIT_SHALLOW 1
... ...