summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2011-11-22 21:23:31 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2011-11-22 21:23:31 (GMT)
commite9547efa96ab8f1b28914749fd80dfa7d43ca998 (patch)
tree08fa0ae7ddf24a8cb2667c011ce4cf8ebba17c8a /Modules
parent636740c478068685727ffe03f6e469418ca42282 (diff)
parent20cb5edbcaaf89c35638911c27e6aec1c7fc022f (diff)
downloadCMake-e9547efa96ab8f1b28914749fd80dfa7d43ca998.zip
CMake-e9547efa96ab8f1b28914749fd80dfa7d43ca998.tar.gz
CMake-e9547efa96ab8f1b28914749fd80dfa7d43ca998.tar.bz2
Merge topic 'FindBISON-version-regex'
20cb5ed FindBISON: Fix matching output of "bison --version" f30f9a5 FindBISON: Fix bison++ version parsing to avoid "Offending entry"
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindBISON.cmake13
1 files changed, 11 insertions, 2 deletions
diff --git a/Modules/FindBISON.cmake b/Modules/FindBISON.cmake
index e855a27..edde9eb 100644
--- a/Modules/FindBISON.cmake
+++ b/Modules/FindBISON.cmake
@@ -67,8 +67,17 @@ IF(BISON_EXECUTABLE)
IF(NOT ${BISON_version_result} EQUAL 0)
MESSAGE(SEND_ERROR "Command \"${BISON_EXECUTABLE} --version\" failed with output:\n${BISON_version_error}")
ELSE()
- STRING(REGEX REPLACE "^bison \\(GNU Bison\\) ([^\n]+)\n.*" "\\1"
- BISON_VERSION "${BISON_version_output}")
+ # Bison++
+ IF("${BISON_version_output}" MATCHES "^bison\\+\\+")
+ STRING(REGEX REPLACE "^bison\\+\\+ Version ([^,]+).*" "\\1"
+ BISON_VERSION "${BISON_version_output}")
+ # GNU Bison
+ ELSEIF("${BISON_version_output}" MATCHES "^bison[^+]")
+ STRING(REGEX REPLACE "^bison \\(GNU Bison\\) ([^\n]+)\n.*" "\\1"
+ BISON_VERSION "${BISON_version_output}")
+ ELSE()
+ SET(BISON_VERSION "unknown")
+ ENDIF()
ENDIF()
# internal macro