From e73ad22e384b392834614ab63c3d65543e78829a Mon Sep 17 00:00:00 2001 From: David Cole Date: Wed, 2 Jun 2010 18:05:41 -0400 Subject: [PATCH] Fix ExternalProject test failures on dashboards. Double quote executable names that may have spaces in them. Do not run the new git portions of the test on machines that have git < version 1.6.5 on them. --- Tests/ExternalProject/CMakeLists.txt | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt index 09b761919..4c93ef3e1 100644 --- a/Tests/ExternalProject/CMakeLists.txt +++ b/Tests/ExternalProject/CMakeLists.txt @@ -161,7 +161,7 @@ if(do_cvs_tests) SOURCE_DIR ${local_cvs_repo} URL ${CMAKE_CURRENT_SOURCE_DIR}/cvsrepo.tgz BUILD_COMMAND "" - CONFIGURE_COMMAND ${CVS_EXECUTABLE} --version + CONFIGURE_COMMAND "${CVS_EXECUTABLE}" --version INSTALL_COMMAND "" ) @@ -257,7 +257,7 @@ if(do_svn_tests) SOURCE_DIR ${local_svn_repo} URL ${CMAKE_CURRENT_SOURCE_DIR}/svnrepo.tgz BUILD_COMMAND "" - CONFIGURE_COMMAND ${Subversion_SVN_EXECUTABLE} --version + CONFIGURE_COMMAND "${Subversion_SVN_EXECUTABLE}" --version INSTALL_COMMAND "" ) @@ -304,6 +304,19 @@ 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 "No ExternalProject git tests with git client less than version 1.6.5") + set(do_git_tests 0) + endif() endif() @@ -318,7 +331,7 @@ if(do_git_tests) SOURCE_DIR ${local_git_repo} URL ${CMAKE_CURRENT_SOURCE_DIR}/gitrepo.tgz BUILD_COMMAND "" - CONFIGURE_COMMAND ${git_EXECUTABLE} --version + CONFIGURE_COMMAND "${git_EXECUTABLE}" --version INSTALL_COMMAND "" )