Make FindBISON work properly with non-C locales (#11326)
Applying the patch attached to http://public.kitware.com/Bug/view.php?id=11326 It sets LC_ALL to C before calling execute_process(), so the output is in english. Alex
This commit is contained in:
parent
00b327fed8
commit
506805c999
|
@ -51,12 +51,19 @@ FIND_PROGRAM(BISON_EXECUTABLE bison DOC "path to the bison executable")
|
|||
MARK_AS_ADVANCED(BISON_EXECUTABLE)
|
||||
|
||||
IF(BISON_EXECUTABLE)
|
||||
# the bison commands should be executed with the C locale, otherwise
|
||||
# the message (which are parsed) may be translated
|
||||
SET(_Bison_SAVED_LC_ALL "$ENV{LC_ALL}")
|
||||
SET(ENV{LC_ALL} C)
|
||||
|
||||
EXECUTE_PROCESS(COMMAND ${BISON_EXECUTABLE} --version
|
||||
OUTPUT_VARIABLE BISON_version_output
|
||||
ERROR_VARIABLE BISON_version_error
|
||||
RESULT_VARIABLE BISON_version_result
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
SET(ENV{LC_ALL} ${_Bison_SAVED_LC_ALL})
|
||||
|
||||
IF(NOT ${BISON_version_result} EQUAL 0)
|
||||
MESSAGE(SEND_ERROR "Command \"${BISON_EXECUTABLE} --version\" failed with output:\n${BISON_version_error}")
|
||||
ELSE()
|
||||
|
|
Loading…
Reference in New Issue