--- cmake_modules/CMakeUseFlex.cmake.orig 2012-10-04 00:35:17.000000000 +0200 +++ cmake_modules/CMakeUseFlex.cmake 2012-10-30 09:45:22.000000000 +0100 @@ -30,7 +30,9 @@ IF(NOT FLEX_EXECUTABLE) MESSAGE(STATUS "Looking for flex") FIND_PROGRAM(FLEX_EXECUTABLE flex) - IF(FLEX_EXECUTABLE) +ENDIF(NOT FLEX_EXECUTABLE) + +IF(FLEX_EXECUTABLE) EXEC_PROGRAM( ${FLEX_EXECUTABLE} ARGS --version @@ -51,13 +53,12 @@ GET_FILENAME_COMPONENT(_flex_hint "${_flex_path}/../include" ABSOLUTE) FIND_PATH(FLEX_INCLUDE_DIR FlexLexer.h HINTS "${_flex_hint}") - ELSE (FLEX_EXECUTABLE) +ELSE (FLEX_EXECUTABLE) SET (FLEX_MAJOR_VERSION "0") SET (FLEX_MINOR_VERSION "0") SET (FLEX_REVISION_VERSION "0") - ENDIF(FLEX_EXECUTABLE) - SET (FLEX_VERSION_FULL ${FLEX_MAJOR_VERSION}.${FLEX_MINOR_VERSION}.${FLEX_REVISION_VERSION} CACHE STRING "The Flex version" FORCE) -ENDIF(NOT FLEX_EXECUTABLE) +ENDIF(FLEX_EXECUTABLE) +SET (FLEX_VERSION_FULL ${FLEX_MAJOR_VERSION}.${FLEX_MINOR_VERSION}.${FLEX_REVISION_VERSION} CACHE STRING "The Flex version" FORCE) IF(FLEX_EXECUTABLE) MACRO(FLEX_FILE FILENAME)