summaryrefslogtreecommitdiffstats
path: root/Tests/CTestUpdateCVS.cmake.in
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2012-03-02 19:20:58 (GMT)
committerBrad King <brad.king@kitware.com>2012-03-02 19:23:01 (GMT)
commite3336025672383c6345989af9539943a74850614 (patch)
tree08ae3e009ea4a74e7a9aaa67401262cc82dbfd4a /Tests/CTestUpdateCVS.cmake.in
parent5012787c3c63523115f2f5254644d320ad27beba (diff)
downloadCMake-e3336025672383c6345989af9539943a74850614.zip
CMake-e3336025672383c6345989af9539943a74850614.tar.gz
CMake-e3336025672383c6345989af9539943a74850614.tar.bz2
Fix MSYS CVS local test repo path format (#13001)
The MSYS cvs tool interprets "c:/" as a "machine:" name for SSH. Detect the MSYS cvs by looking for the string "msys" in the executable file itself. Then convert the repo path to an MSYS path such as "/c/...". Fix both the CTest.UpdateCVS and ExternalProject tests that use local CVS repositories.
Diffstat (limited to 'Tests/CTestUpdateCVS.cmake.in')
-rw-r--r--Tests/CTestUpdateCVS.cmake.in13
1 files changed, 13 insertions, 0 deletions
diff --git a/Tests/CTestUpdateCVS.cmake.in b/Tests/CTestUpdateCVS.cmake.in
index a04673e..f7f5db6 100644
--- a/Tests/CTestUpdateCVS.cmake.in
+++ b/Tests/CTestUpdateCVS.cmake.in
@@ -18,6 +18,19 @@ set(CVS "@CVS_EXECUTABLE@")
message(" cvs = ${CVS}")
set(REPO ${TOP}/repo)
+
+# The MSYS cvs tool interprets "c:/" as a "machine:" name for SSH.
+# Detect the MSYS cvs and convert the repo path to an MSYS path.
+if(WIN32)
+ if(EXISTS "${CVS}")
+ file(STRINGS "${CVS}" cvs_is_msys LIMIT_COUNT 1 REGEX "[Mm][Ss][Yy][Ss]")
+ if(cvs_is_msys)
+ message(" '${CVS}' is from MSYS (contains '${cvs_is_msys}')")
+ string(REGEX REPLACE "^([A-Za-z]):" "/\\1" REPO "${REPO}")
+ endif()
+ endif()
+endif()
+
set(CVSCMD ${CVS} -d${REPO})
# CVSNT requires an extra option to 'cvs init'.