FindFLEX: fix version parsing when the executable is quoted

This commit is contained in:
Rolf Eike Beer 2012-01-23 23:40:17 +01:00
parent 2cf5df3e58
commit 0b2e81c63c
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"
# newer versions use "basename(executable) X.Y"
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}")
UNSET(FLEX_EXE_NAME)
ENDIF()