]> granicus.if.org Git - icinga2/commitdiff
Improve Flex version detection on Windows
authorGunnar Beutner <gunnar@beutner.name>
Mon, 16 Mar 2015 12:31:33 +0000 (13:31 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Mon, 16 Mar 2015 12:32:02 +0000 (13:32 +0100)
refs #8750

lib/config/CMakeLists.txt
third-party/cmake/FindFLEX.cmake
tools/mkclass/CMakeLists.txt

index 9b38981e559447ec2a12af67fda24888b6905bcb..52cbf5640ef738afd4f3141c03972dfad7b68b65 100644 (file)
 find_package(BISON 2.3.0 REQUIRED)
 find_package(FLEX 2.5.31 REQUIRED)
 
-if("${FLEX_VERSION}" VERSION_LESS "2.5.31")
-    message(SEND_ERROR "Your version of flex is too old. You can specify an alternative path using -DFLEX_EXECUTABLE=/path/to/flex")
-endif()
-
 bison_target(config_parser config_parser.yy ${CMAKE_CURRENT_BINARY_DIR}/config_parser.cc)
 set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/config_parser.cc PROPERTY EXCLUDE_UNITY_BUILD TRUE)
 
index df151fb366e4628fa55a91e5c7f216e8b57bf52e..cd54832c3f190ee32afd13f6d15185d4eae6fa09 100644 (file)
@@ -117,6 +117,12 @@ IF(FLEX_EXECUTABLE)
       FLEX_VERSION "${FLEX_version_output}")
   ENDIF()
 
+  IF(FLEX_FIND_VERSION)
+    IF("${FLEX_VERSION}" VERSION_LESS "${FLEX_FIND_VERSION}")
+      MESSAGE(SEND_ERROR "Your version of flex is too old. You can specify an alternative path using -DFLEX_EXECUTABLE=/path/to/flex")
+    ENDIF()
+  ENDIF()
+
   #============================================================
   # FLEX_TARGET (public macro)
   #============================================================
@@ -176,4 +182,4 @@ INCLUDE(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(FLEX FLEX_EXECUTABLE
                                        FLEX_VERSION)
 
-# FindFLEX.cmake ends here
\ No newline at end of file
+# FindFLEX.cmake ends here
index e5beb13b6f17b6bb63a2bc631f0744d91d7febc8..a94c6046d568d0249740508978c21fc20777b565 100644 (file)
 find_package(BISON 2.3.0 REQUIRED)
 find_package(FLEX 2.5.31 REQUIRED)
 
-if("${FLEX_VERSION}" VERSION_LESS "2.5.31")
-    message(SEND_ERROR "Your version of flex is too old. You can specify an alternative path using -DFLEX_EXECUTABLE=/path/to/flex")
-endif()
-
 bison_target(class_parser class_parser.yy ${CMAKE_CURRENT_BINARY_DIR}/class_parser.cc)
 flex_target(class_lexer class_lexer.ll ${CMAKE_CURRENT_BINARY_DIR}/class_lexer.cc)
 add_flex_bison_dependency(class_lexer class_parser)