Skip to content

Commit

Permalink
fixup! CMake updates from @slurps-mad-rips
Browse files Browse the repository at this point in the history
  • Loading branch information
henryiii committed Jan 9, 2020
1 parent a08e25e commit 0cc8806
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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
Expand Down Expand Up @@ -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()

Expand Down
8 changes: 5 additions & 3 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0cc8806

Please sign in to comment.