]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
CMake: make BUILD_TESTING dependent option
authorSergei Nikulov <sergey.nikulov@gmail.com>
Tue, 13 Oct 2020 20:37:15 +0000 (23:37 +0300)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 29 Oct 2020 08:34:30 +0000 (09:34 +0100)
CMake will now handle BUILD_TESTING depending on PERL_FOUND and
CURL_DISABLE_TESTING

Ref: #6036
Closes #6072

CMakeLists.txt

index f3d0a5614ff2e4fe9113629f083d83f56b753536..b25488fe448d79f52d2627d8174e03ad0a44833a 100644 (file)
@@ -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()