summaryrefslogtreecommitdiffstats
path: root/Modules/FindHg.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-10-21 19:42:53 (GMT)
committerBrad King <brad.king@kitware.com>2014-10-22 14:52:08 (GMT)
commited997de4f21620fb25f7380fd664bc3c1d2f8ec8 (patch)
treedddee9525c3d3db5ce75648f9043ca0c9697af83 /Modules/FindHg.cmake
parent54ff77dc621a91302abad0ab38d9bd26de8914b9 (diff)
downloadCMake-ed997de4f21620fb25f7380fd664bc3c1d2f8ec8.zip
CMake-ed997de4f21620fb25f7380fd664bc3c1d2f8ec8.tar.gz
CMake-ed997de4f21620fb25f7380fd664bc3c1d2f8ec8.tar.bz2
FindHg: Do not use cygwin hg on Windows
The cygwin hg client is a text file with a '#!/bin/python" line. This cannot run on Windows.
Diffstat (limited to 'Modules/FindHg.cmake')
-rw-r--r--Modules/FindHg.cmake4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/FindHg.cmake b/Modules/FindHg.cmake
index c418afd..34d763e 100644
--- a/Modules/FindHg.cmake
+++ b/Modules/FindHg.cmake
@@ -66,7 +66,11 @@ if(HG_EXECUTABLE)
execute_process(COMMAND ${HG_EXECUTABLE} --version
OUTPUT_VARIABLE hg_version
ERROR_QUIET
+ RESULT_VARIABLE hg_result
OUTPUT_STRIP_TRAILING_WHITESPACE)
+ if(hg_result MATCHES "is not a valid Win32 application")
+ set_property(CACHE HG_EXECUTABLE PROPERTY VALUE "HG_EXECUTABLE-NOTFOUND")
+ endif()
if(hg_version MATCHES "^Mercurial Distributed SCM \\(version ([0-9][^)]*)\\)")
set(HG_VERSION_STRING "${CMAKE_MATCH_1}")
endif()