1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-04-29 12:13:52 +00:00

fixup! CMake updates from @slurps-mad-rips

This commit is contained in:
Henry Schreiner 2020-01-08 17:30:02 -05:00 committed by Henry Schreiner
parent a08e25ea7b
commit 0cc8806ec5
3 changed files with 9 additions and 6 deletions

View File

@ -46,7 +46,7 @@ list(APPEND force-libcxx "CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME")
list(APPEND build-docs "CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME")
list(APPEND build-docs "NOT CMAKE_VERSION VERSION_LESS 3.11")
list(APPEND build-docs "Doxygen_FOUND")
list(APPEND build-docs "EXISTS docs")
list(APPEND build-docs "EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/docs")
option(CLI11_WARNINGS_AS_ERRORS "Turn all warnings into errors (for CI)")
option(CLI11_SINGLE_FILE "Generate a single header file")
@ -64,7 +64,7 @@ cmake_dependent_option(CLI11_BUILD_TESTS
cmake_dependent_option(CLI11_BUILD_EXAMPLES
"Build CLI11 examples" ON
"CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME;EXISTS examples" OFF)
"CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME;EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/examples" OFF)
cmake_dependent_option(CLI11_BUILD_EXAMPLES_JSON
"Build CLI11 json example" OFF
@ -267,7 +267,7 @@ if(CLI11_BUILD_DOCS)
endif()
# From a build system, this might not be included.
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND EXISTS book)
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/book")
add_subdirectory(book)
endif()

View File

@ -12,10 +12,12 @@ function(add_cli_exe T)
endfunction()
if(CLI11_BUILD_EXAMPLES_JSON)
message(STATUS "Using nlohmann/json")
FetchContent_Declare(json
GIT_REPOSITORY https://github.com/nlohmann/json.git
GIT_SHALLOW 1
GIT_TAG v3.7.3)
URL https://github.com/nlohmann/json/releases/download/v3.7.3/include.zip
URL_HASH "SHA256=87b5884741427220d3a33df1363ae0e8b898099fbc59f1c451113f6732891014"
)
FetchContent_GetProperties(json)
if (NOT json_POPULATED)
FetchContent_Populate(json)

View File

@ -6,6 +6,7 @@ endif()
list(APPEND CMAKE_MODULE_PATH "${CLI11_SOURCE_DIR}/cmake")
if(CLI11_SANITIZERS)
message(STATUS "Using arsenm/sanitizers-cmake")
FetchContent_Declare(sanitizers
GIT_REPOSITORY https://github.com/arsenm/sanitizers-cmake.git
GIT_SHALLOW 1