summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-06-12 21:53:20 (GMT)
committerBrad King <brad.king@kitware.com>2023-06-12 21:53:56 (GMT)
commit0c2610bd300218165e72524b87e998fd06d86ef5 (patch)
tree2945e4df207bf5dc9c11728da079f3616edce78f /Tests
parent66f7d9e6e03f4b38bbd5e456fa32397d809f5bfb (diff)
downloadCMake-0c2610bd300218165e72524b87e998fd06d86ef5.zip
CMake-0c2610bd300218165e72524b87e998fd06d86ef5.tar.gz
CMake-0c2610bd300218165e72524b87e998fd06d86ef5.tar.bz2
Tests: Find GIT_EXECUTABLE early enough to use in all tests
Some tests work only if a `git` executable is available.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLists.txt7
1 files changed, 3 insertions, 4 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 5ef77fd..53bb1e6 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -142,6 +142,9 @@ if(BUILD_TESTING)
)
endif()
+ # Look for git to use for tests.
+ find_program(GIT_EXECUTABLE NAMES git)
+
# Look for rpmbuild to use for tests.
# The tool does not work with spaces in the path.
if(NOT CMAKE_CURRENT_BINARY_DIR MATCHES " ")
@@ -2688,10 +2691,6 @@ if(BUILD_TESTING)
endif()
# Test CTest Update with GIT
- if(NOT DEFINED CMake_TEST_CTestUpdate_GIT OR CMake_TEST_CTestUpdate_GIT)
- find_program(GIT_EXECUTABLE NAMES git)
- mark_as_advanced(GIT_EXECUTABLE)
- endif()
if(NOT DEFINED CMake_TEST_CTestUpdate_GIT AND GIT_EXECUTABLE
AND (UNIX OR NOT "${GIT_EXECUTABLE}" MATCHES "cygwin"))
set(CMake_TEST_CTestUpdate_GIT 1)