Skip to content
Permalink
Browse files
CMake: added check to accept Bison 2.0 or higher
(it's known not to work correctly with 1.28)


git-svn-id: http://svn.osgeo.org/qgis/trunk@6524 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Feb 4, 2007
1 parent ccf59bb commit a45653077778c40302d6ea0bdff5ca2ce58ccb03
Showing with 17 additions and 2 deletions.
  1. +17 −2 cmake/Bison.cmake
@@ -5,9 +5,24 @@ MACRO(FIND_BISON)
IF(NOT BISON_EXECUTABLE)
FIND_PROGRAM(BISON_EXECUTABLE bison)
IF (NOT BISON_EXECUTABLE)
MESSAGE(FATAL_ERROR "Bison not found - aborting")
ENDIF (NOT BISON_EXECUTABLE)

MESSAGE(FATAL_ERROR "Bison not found - aborting")

ELSE (NOT BISON_EXECUTABLE)

EXEC_PROGRAM(${BISON_EXECUTABLE} ARGS --version OUTPUT_VARIABLE BISON_VERSION_STR)
# get first line in case it's multiline
STRING(REGEX REPLACE "([^\n]+).*" "\\1" FIRST_LINE "${BISON_VERSION_STR}")
# get version information
STRING(REGEX REPLACE ".* ([0-9]+)\\.([0-9]+)" "\\1" BISON_VERSION_MAJOR "${FIRST_LINE}")
STRING(REGEX REPLACE ".* ([0-9]+)\\.([0-9]+)" "\\2" BISON_VERSION_MINOR "${FIRST_LINE}")
IF (BISON_VERSION_MAJOR LESS 2)
MESSAGE (FATAL_ERROR "Bison version is too old (${BISON_VERSION_MAJOR}.${BISON_VERSION_MINOR}). Use 2.0 or higher.")
ENDIF (BISON_VERSION_MAJOR LESS 2)

ENDIF (NOT BISON_EXECUTABLE)
ENDIF(NOT BISON_EXECUTABLE)

ENDMACRO(FIND_BISON)

MACRO(ADD_BISON_FILES _sources )

0 comments on commit a456530

Please sign in to comment.