Skip to content

Commit

Permalink
CMake: added check to accept Bison 2.0 or higher
Browse files Browse the repository at this point in the history
(it's known not to work correctly with 1.28)


git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6524 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Feb 4, 2007
1 parent 3e654a9 commit 534b9a7
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions cmake/Bison.cmake
Expand Up @@ -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 )
Expand Down

0 comments on commit 534b9a7

Please sign in to comment.