diff options
author | Craig Scott <craig.scott@crascit.com> | 2021-01-16 04:50:13 (GMT) |
---|---|---|
committer | Craig Scott <craig.scott@crascit.com> | 2021-01-19 23:16:21 (GMT) |
commit | 76fdeb6d13c4cfdaac8e933a9ef94c8e9def54ef (patch) | |
tree | 416ee6fb2612e686da83892b7bbd8f606a9e2636 /Tests | |
parent | 315a200f0c45415e8ab0da058aab9bbfa39c3c05 (diff) | |
download | CMake-76fdeb6d13c4cfdaac8e933a9ef94c8e9def54ef.zip CMake-76fdeb6d13c4cfdaac8e933a9ef94c8e9def54ef.tar.gz CMake-76fdeb6d13c4cfdaac8e933a9ef94c8e9def54ef.tar.bz2 |
Tests: FindGit already provides the git version, re-use it
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/ExternalProject/CMakeLists.txt | 10 | ||||
-rw-r--r-- | Tests/ExternalProjectUpdate/CMakeLists.txt | 12 | ||||
-rw-r--r-- | Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake | 10 |
3 files changed, 7 insertions, 25 deletions
diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt index a1130dc..8fd44b4 100644 --- a/Tests/ExternalProject/CMakeLists.txt +++ b/Tests/ExternalProject/CMakeLists.txt @@ -298,15 +298,9 @@ set(do_git_tests 0) if(GIT_EXECUTABLE) set(do_git_tests 1) - execute_process( - COMMAND "${GIT_EXECUTABLE}" --version - OUTPUT_VARIABLE ov - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - string(REGEX REPLACE "^git version (.+)$" "\\1" git_version "${ov}") - message(STATUS "git_version='${git_version}'") + message(STATUS "GIT_VERSION_STRING='${GIT_VERSION_STRING}'") - if(git_version VERSION_LESS 1.6.5) + if("${GIT_VERSION_STRING}" VERSION_LESS 1.6.5) message(STATUS "No ExternalProject git tests with git client less than version 1.6.5") set(do_git_tests 0) endif() diff --git a/Tests/ExternalProjectUpdate/CMakeLists.txt b/Tests/ExternalProjectUpdate/CMakeLists.txt index fc10c67..b31a38b 100644 --- a/Tests/ExternalProjectUpdate/CMakeLists.txt +++ b/Tests/ExternalProjectUpdate/CMakeLists.txt @@ -51,15 +51,9 @@ set(do_git_tests 0) if(GIT_EXECUTABLE) set(do_git_tests 1) - execute_process( - COMMAND "${GIT_EXECUTABLE}" --version - OUTPUT_VARIABLE ov - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - string(REGEX REPLACE "^git version (.+)$" "\\1" git_version "${ov}") - message(STATUS "git_version='${git_version}'") - - if(git_version VERSION_LESS 1.6.5) + message(STATUS "GIT_VERSION_STRING='${GIT_VERSION_STRING}'") + + if("${GIT_VERSION_STRING}" VERSION_LESS 1.6.5) message(STATUS "No ExternalProject git tests with git client less than version 1.6.5") set(do_git_tests 0) endif() diff --git a/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake b/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake index ddc513f..4b1d074 100644 --- a/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake +++ b/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake @@ -167,15 +167,9 @@ set(do_git_tests 0) if(GIT_EXECUTABLE) set(do_git_tests 1) - execute_process( - COMMAND "${GIT_EXECUTABLE}" --version - OUTPUT_VARIABLE ov - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - string(REGEX REPLACE "^git version (.+)$" "\\1" git_version "${ov}") - message(STATUS "git_version='${git_version}'") + message(STATUS "GIT_VERSION_STRING='${GIT_VERSION_STRING}'") - if(git_version VERSION_LESS 1.6.5) + if("${GIT_VERSION_STRING}" VERSION_LESS 1.6.5) message(STATUS "No ExternalProject git tests with git client less than version 1.6.5") set(do_git_tests 0) endif() |