check flex version (fixes compilation under rhel 5)

This commit is contained in:
Sears Russell 2010-01-06 23:43:31 +00:00
parent 1af589dd18
commit 078a8619fe

View file

@ -1,4 +1,6 @@
if(BISON_EXECUTABLE)
STRING(REGEX MATCH NEW_ENOUGH_FLEX "^2\\.5\\.3" FLEX_VERSION)
if(NEW_ENOUGH_FLEX)
BISON_TARGET(RefParser ${CMAKE_CURRENT_SOURCE_DIR}/parse.y ${CMAKE_CURRENT_BINARY_DIR}/y.tab.c)
FLEX_TARGET(RefParser ${CMAKE_CURRENT_SOURCE_DIR}/lexer.l ${CMAKE_CURRENT_BINARY_DIR}/lex.yy.c)
#SET(INCLUDE_DIR ${INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
@ -8,4 +10,5 @@ ADD_EXECUTABLE(parse_test ${CMAKE_CURRENT_BINARY_DIR}/lex.yy.c ${CMAKE_CURRENT_B
SET_TARGET_PROPERTIES(refparse PROPERTIES COMPILE_FLAGS "-Wno-implicit -Wno-unused -I ${CMAKE_CURRENT_SOURCE_DIR}")
SET_TARGET_PROPERTIES(parse_test PROPERTIES COMPILE_FLAGS "-Wno-implicit -Wno-unused -I ${CMAKE_CURRENT_SOURCE_DIR}")
ADD_TEST(test_parser ${CMAKE_CURRENT_SOURCE_DIR}/test_parser.pl)
endif(NEW_ENOUGH_FLEX)
endif(BISON_EXECUTABLE)