FindBISON: Fix matching output of "bison --version"
The output may contain semicolons, which will confuse the IF() because of missing quoting.
This commit is contained in:
parent
f30f9a500c
commit
20cb5edbca
|
@ -68,11 +68,11 @@ IF(BISON_EXECUTABLE)
|
||||||
MESSAGE(SEND_ERROR "Command \"${BISON_EXECUTABLE} --version\" failed with output:\n${BISON_version_error}")
|
MESSAGE(SEND_ERROR "Command \"${BISON_EXECUTABLE} --version\" failed with output:\n${BISON_version_error}")
|
||||||
ELSE()
|
ELSE()
|
||||||
# Bison++
|
# Bison++
|
||||||
IF(${BISON_version_output} MATCHES "^bison\\+\\+")
|
IF("${BISON_version_output}" MATCHES "^bison\\+\\+")
|
||||||
STRING(REGEX REPLACE "^bison\\+\\+ Version ([^,]+).*" "\\1"
|
STRING(REGEX REPLACE "^bison\\+\\+ Version ([^,]+).*" "\\1"
|
||||||
BISON_VERSION "${BISON_version_output}")
|
BISON_VERSION "${BISON_version_output}")
|
||||||
# GNU Bison
|
# GNU Bison
|
||||||
ELSEIF(${BISON_version_output} MATCHES "^bison[^+]")
|
ELSEIF("${BISON_version_output}" MATCHES "^bison[^+]")
|
||||||
STRING(REGEX REPLACE "^bison \\(GNU Bison\\) ([^\n]+)\n.*" "\\1"
|
STRING(REGEX REPLACE "^bison \\(GNU Bison\\) ([^\n]+)\n.*" "\\1"
|
||||||
BISON_VERSION "${BISON_version_output}")
|
BISON_VERSION "${BISON_version_output}")
|
||||||
ELSE()
|
ELSE()
|
||||||
|
|
Loading…
Reference in New Issue