summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-03-02 13:36:31 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-03-02 13:36:31 (GMT)
commit5261c357aef02f63a44060a6bea3e7f614758e08 (patch)
treebfaa4f1d54c2997e936d2b8bb3d12eae2ed6ffd4
parentb3381c5c79e2b7ef57a1d035e73d37ec2ee0aa45 (diff)
parentcfb22354b8bff1f7eddc117616a80774d456f467 (diff)
downloadCMake-5261c357aef02f63a44060a6bea3e7f614758e08.zip
CMake-5261c357aef02f63a44060a6bea3e7f614758e08.tar.gz
CMake-5261c357aef02f63a44060a6bea3e7f614758e08.tar.bz2
Merge topic 'locale-agnostic-findhg'
cfb22354 FindHg: Run hg with C locale when querying its version.
-rw-r--r--Modules/FindHg.cmake10
1 files changed, 10 insertions, 0 deletions
diff --git a/Modules/FindHg.cmake b/Modules/FindHg.cmake
index 34d763e..bdbb79b 100644
--- a/Modules/FindHg.cmake
+++ b/Modules/FindHg.cmake
@@ -63,11 +63,21 @@ find_program(HG_EXECUTABLE
mark_as_advanced(HG_EXECUTABLE)
if(HG_EXECUTABLE)
+ set(_saved_lc_all "$ENV{LC_ALL}")
+ set(ENV{LC_ALL} "C")
+
+ set(_saved_language "$ENV{LANGUAGE}")
+ set(ENV{LANGUAGE})
+
execute_process(COMMAND ${HG_EXECUTABLE} --version
OUTPUT_VARIABLE hg_version
ERROR_QUIET
RESULT_VARIABLE hg_result
OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ set(ENV{LC_ALL} ${_saved_lc_all})
+ set(ENV{LANGUAGE} ${_saved_language})
+
if(hg_result MATCHES "is not a valid Win32 application")
set_property(CACHE HG_EXECUTABLE PROPERTY VALUE "HG_EXECUTABLE-NOTFOUND")
endif()