CMake: make BUILD_TESTING dependent option

CMake will now handle BUILD_TESTING depending on PERL_FOUND and
CURL_DISABLE_TESTING

Ref: #6036
Closes #6072
This commit is contained in:
Sergei Nikulov 2020-10-13 23:37:15 +03:00 committed by Daniel Stenberg
parent 9a844625c4
commit 3a1e798009
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
1 changed files with 4 additions and 4 deletions

View 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()