Commit cfb22354 authored by Nils Gladitz's avatar Nils Gladitz

FindHg: Run hg with C locale when querying its version.

LANGUAGE should be ignored when LC_ALL=C.
It seems this isn't the case with hg so set both.
parent ae09fce8
......@@ -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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment