FindFLEX: fix version extraction on Apple

The space in 'flex 2.5.35 Apple(flex-31)' caused the version extraction to
fail. Ignore everything after the first space following the version number.
This commit is contained in:
Rolf Eike Beer 2012-08-30 15:33:27 +02:00
parent 3e72df1484
commit af06482d24
1 changed files with 1 additions and 1 deletions

View File

@ -94,7 +94,7 @@ if(FLEX_EXECUTABLE)
# older versions of flex printed "/full/path/to/executable version X.Y" # older versions of flex printed "/full/path/to/executable version X.Y"
# newer versions use "basename(executable) X.Y" # newer versions use "basename(executable) X.Y"
get_filename_component(FLEX_EXE_NAME "${FLEX_EXECUTABLE}" NAME) get_filename_component(FLEX_EXE_NAME "${FLEX_EXECUTABLE}" NAME)
string(REGEX REPLACE "^.*${FLEX_EXE_NAME}\"? (version )?([0-9]+[^ ]*)$" "\\2" string(REGEX REPLACE "^.*${FLEX_EXE_NAME}\"? (version )?([0-9]+[^ ]*)( .*)?$" "\\2"
FLEX_VERSION "${FLEX_version_output}") FLEX_VERSION "${FLEX_version_output}")
unset(FLEX_EXE_NAME) unset(FLEX_EXE_NAME)
endif() endif()