From 078a8619fe4a108c5e7d41477545af2c77f3859b Mon Sep 17 00:00:00 2001 From: Sears Russell Date: Wed, 6 Jan 2010 23:43:31 +0000 Subject: [PATCH] check flex version (fixes compilation under rhel 5) --- src/apps/referential/lang/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/apps/referential/lang/CMakeLists.txt b/src/apps/referential/lang/CMakeLists.txt index 29b5bb5..8c44791 100644 --- a/src/apps/referential/lang/CMakeLists.txt +++ b/src/apps/referential/lang/CMakeLists.txt @@ -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)