Explorar o código

Add version checking support to FindFlex and FindPerlLibs

Use the new mode of FPHSA() to add version checking for these two modules.

Alex
Alex Neundorf %!s(int64=15) %!d(string=hai) anos
pai
achega
cb9d1eaca4
Modificáronse 2 ficheiros con 12 adicións e 3 borrados
  1. 6 1
      Modules/FindFLEX.cmake
  2. 6 2
      Modules/FindPerlLibs.cmake

+ 6 - 1
Modules/FindFLEX.cmake

@@ -6,6 +6,10 @@
 #  FLEX_VERSION - the version of flex
 #  FLEX_LIBRARIES - The flex libraries
 #
+# The minimum required version of flex can be specified using the
+# standard syntax, e.g. FIND_PACKAGE(FLEX 2.5.13)
+#
+#
 # If flex is found on the system, the module provides the macro:
 #  FLEX_TARGET(Name FlexInput FlexOutput [COMPILE_FLAGS <string>])
 # which creates a custom command  to generate the <FlexOutput> file from
@@ -136,6 +140,7 @@ IF(FLEX_EXECUTABLE)
 ENDIF(FLEX_EXECUTABLE)
 
 INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(FLEX DEFAULT_MSG FLEX_EXECUTABLE)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(FLEX REQUIRED_VARS FLEX_EXECUTABLE
+                                       VERSION_VAR FLEX_VERSION)
 
 # FindFLEX.cmake ends here

+ 6 - 2
Modules/FindPerlLibs.cmake

@@ -8,6 +8,9 @@
 #  PERL_LIBRARY      = path to libperl
 #  PERL_EXECUTABLE   = full path to the perl binary
 #
+# The minimum required version of Perl can be specified using the
+# standard syntax, e.g. FIND_PACKAGE(PerlLibs 6.0)
+#
 #  The following variables are also available if needed
 #  (introduced after CMake 2.6.4)
 #
@@ -227,8 +230,9 @@ endif (PERL_EXECUTABLE)
 
 # handle the QUIETLY and REQUIRED arguments and set PERLLIBS_FOUND to TRUE if 
 # all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(PerlLibs DEFAULT_MSG PERL_LIBRARY PERL_INCLUDE_PATH)
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(PerlLibs REQUIRED_VARS PERL_LIBRARY PERL_INCLUDE_PATH
+                                           VERSION_VAR PERL_VERSION)
 
 # Introduced after CMake 2.6.4 to bring module into compliance
 set(PERL_INCLUDE_DIR  ${PERL_INCLUDE_PATH})