diff --git a/CMakeLists.txt b/CMakeLists.txt index 79404b8..02e3d43 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -156,6 +156,10 @@ endif() cmake_dependent_option(CLI11_SINGLE_FILE_TESTS "Duplicate all the tests for a single file build" OFF "CLI11_SINGLE_FILE" OFF) cmake_dependent_option(CLI11_TESTING "Build the tests and add them" ON "CUR_PROJ" OFF) +if(DEFINED BUILD_TESTING) + cmake_dependent_option(CLI11_TESTING "" ON "BUILD_TESTING" OFF) + message(STATUS "BUILD_TESTING is defined and it supersedes CLI11_TESTING. Has forced to ${CLI11_TESTING}") +endif() if(CLI11_TESTING) enable_testing() add_subdirectory(tests)