Commit 0387f35ec8212041fb0bae6196a922735f2fbe01

Authored by Aleksey Mikhaylov
Committed by Henry Schreiner
1 parent bd4dc911

Prefer BUILD_TESTING over CLI11_TESTING if defined

Showing 1 changed file with 4 additions and 0 deletions
CMakeLists.txt
... ... @@ -156,6 +156,10 @@ endif()
156 156 cmake_dependent_option(CLI11_SINGLE_FILE_TESTS "Duplicate all the tests for a single file build" OFF "CLI11_SINGLE_FILE" OFF)
157 157  
158 158 cmake_dependent_option(CLI11_TESTING "Build the tests and add them" ON "CUR_PROJ" OFF)
  159 +if(DEFINED BUILD_TESTING)
  160 + cmake_dependent_option(CLI11_TESTING "" ON "BUILD_TESTING" OFF)
  161 + message(STATUS "BUILD_TESTING is defined and it supersedes CLI11_TESTING. Has forced to ${CLI11_TESTING}")
  162 +endif()
159 163 if(CLI11_TESTING)
160 164 enable_testing()
161 165 add_subdirectory(tests)
... ...