summaryrefslogtreecommitdiffstats
path: root/Modules/FindBISON.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/FindBISON.cmake')
-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..25fd51d 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