From: Sergei Nikulov Date: Tue, 13 Oct 2020 20:37:15 +0000 (+0300) Subject: CMake: make BUILD_TESTING dependent option X-Git-Tag: curl-7_74_0~123 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3a1e798009799be1e9fad30666351b66f250befb;p=thirdparty%2Fcurl.git CMake: make BUILD_TESTING dependent option CMake will now handle BUILD_TESTING depending on PERL_FOUND and CURL_DISABLE_TESTING Ref: #6036 Closes #6072 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index f3d0a5614f..b25488fe44 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1324,10 +1324,10 @@ if(BUILD_CURL_EXE) add_subdirectory(src) endif() -option(BUILD_TESTING "Build tests" "${PERL_FOUND}") -if(NOT PERL_FOUND) - message(STATUS "Perl not found, testing disabled.") -elseif(BUILD_TESTING) +cmake_dependent_option(BUILD_TESTING "Build tests" + ON "PERL_FOUND;NOT CURL_DISABLE_TESTS" + OFF) +if(BUILD_TESTING) add_subdirectory(tests) endif()