summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeTests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-07-13 13:46:52 (GMT)
committerBrad King <brad.king@kitware.com>2010-07-13 13:46:52 (GMT)
commit7739d786a42a2bbbab87df0c4f869ef8aecae767 (patch)
tree19c1e0625accfe324b2e634e8a79cd481b3b042b /Tests/CMakeTests
parent9203e9187ec3c0ada49af953c3ec1a1f9190cf45 (diff)
parentdbe7525c6e623c3be1dad7dae5948e71b5ac2b6b (diff)
downloadCMake-7739d786a42a2bbbab87df0c4f869ef8aecae767.zip
CMake-7739d786a42a2bbbab87df0c4f869ef8aecae767.tar.gz
CMake-7739d786a42a2bbbab87df0c4f869ef8aecae767.tar.bz2
Merge CPackRPM changes into doc-spelling
Conflicts: Modules/CPackRPM.cmake
Diffstat (limited to 'Tests/CMakeTests')
-rw-r--r--Tests/CMakeTests/CheckSourceTreeTest.cmake.in63
1 files changed, 57 insertions, 6 deletions
diff --git a/Tests/CMakeTests/CheckSourceTreeTest.cmake.in b/Tests/CMakeTests/CheckSourceTreeTest.cmake.in
index 9150aef..73f8b01 100644
--- a/Tests/CMakeTests/CheckSourceTreeTest.cmake.in
+++ b/Tests/CMakeTests/CheckSourceTreeTest.cmake.in
@@ -149,26 +149,77 @@ if(is_git_checkout AND NOT GIT_EXECUTABLE)
# from it:
#
if(ctest_ini_file)
- file(STRINGS "${ctest_ini_file}" lines REGEX "^GITCommand: (.*)$")
- string(REGEX REPLACE "^GITCommand: (.*)$" "\\1" exe "${lines}")
+ file(STRINGS "${ctest_ini_file}" line REGEX "^GITCommand: (.*)$")
+ string(REGEX REPLACE "^GITCommand: (.*)$" "\\1" line "${line}")
+ if("${line}" MATCHES "^\"")
+ string(REGEX REPLACE "^\"([^\"]+)\" *.*$" "\\1" line "${line}")
+ else()
+ string(REGEX REPLACE "^([^ ]+) *.*$" "\\1" line "${line}")
+ endif()
+ set(exe "${line}")
if("${exe}" STREQUAL "GITCOMMAND-NOTFOUND")
set(exe "")
endif()
+ if(exe)
+ message("info: GIT_EXECUTABLE set by 'GITCommand:' from '${ctest_ini_file}'")
+ endif()
if(NOT exe)
- file(STRINGS "${ctest_ini_file}" lines REGEX "^UpdateCommand: (.*)$")
- string(REGEX REPLACE "^UpdateCommand: (.*)$" "\\1" exe "${lines}")
+ file(STRINGS "${ctest_ini_file}" line REGEX "^UpdateCommand: (.*)$")
+ string(REGEX REPLACE "^UpdateCommand: (.*)$" "\\1" line "${line}")
+ if("${line}" MATCHES "^\"")
+ string(REGEX REPLACE "^\"([^\"]+)\" *.*$" "\\1" line "${line}")
+ else()
+ string(REGEX REPLACE "^([^ ]+) *.*$" "\\1" line "${line}")
+ endif()
+ set(exe "${line}")
if("${exe}" STREQUAL "GITCOMMAND-NOTFOUND")
set(exe "")
endif()
+ if(exe)
+ message("info: GIT_EXECUTABLE set by 'UpdateCommand:' from '${ctest_ini_file}'")
+ endif()
+ endif()
+ else()
+ message("info: no DartConfiguration.tcl or CTestConfiguration.ini file...")
+ endif()
+
+ # If we have still not grokked the exe, look in the Update.xml file to see
+ # if we can parse it from there...
+ #
+ if(NOT exe)
+ file(GLOB_RECURSE update_xml_file "${CMake_BINARY_DIR}/Testing/Update.xml")
+ if(update_xml_file)
+ file(STRINGS "${update_xml_file}" line
+ REGEX "^.*<UpdateCommand>(.*)</UpdateCommand>$" LIMIT_COUNT 1)
+ string(REPLACE "&quot\;" "\"" line "${line}")
+ string(REGEX REPLACE "^.*<UpdateCommand>(.*)</UpdateCommand>$" "\\1" line "${line}")
+ if("${line}" MATCHES "^\"")
+ string(REGEX REPLACE "^\"([^\"]+)\" *.*$" "\\1" line "${line}")
+ else()
+ string(REGEX REPLACE "^([^ ]+) *.*$" "\\1" line "${line}")
+ endif()
+ if(line)
+ set(exe "${line}")
+ endif()
+ if(exe)
+ message("info: GIT_EXECUTABLE set by '<UpdateCommand>' from '${update_xml_file}'")
+ endif()
+ else()
+ message("info: no Update.xml file...")
endif()
endif()
if(exe)
set(GIT_EXECUTABLE "${exe}")
- message("info: set GIT_EXECUTABLE to '${GIT_EXECUTABLE}' based on '${ctest_ini_file}'")
+ message("GIT_EXECUTABLE='${GIT_EXECUTABLE}'")
+ message("")
+
+ if(NOT EXISTS "${GIT_EXECUTABLE}")
+ message(FATAL_ERROR "GIT_EXECUTABLE does not exist...")
+ endif()
else()
- message(FATAL_ERROR "could not determine GIT_EXECUTABLE based on '${ctest_ini_file}'...")
+ message(FATAL_ERROR "could not determine GIT_EXECUTABLE...")
endif()
endif()