summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/FindCUDA.cmake37
-rw-r--r--Modules/FindFLEX.cmake7
-rw-r--r--Modules/FindJava.cmake44
-rw-r--r--Modules/FindPackageHandleStandardArgs.cmake2
-rw-r--r--Modules/FindPerlLibs.cmake8
-rw-r--r--Modules/FindRuby.cmake26
-rw-r--r--Modules/FindSWIG.cmake18
-rw-r--r--Modules/FindSquish.cmake3
-rw-r--r--Modules/FindSubversion.cmake28
9 files changed, 66 insertions, 107 deletions
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 81d082a..d9b9d54 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -497,29 +497,6 @@ endif()
# Always set this convenience variable
set(CUDA_VERSION_STRING "${CUDA_VERSION}")
-# Here we need to determine if the version we found is acceptable. We will
-# assume that is unless CUDA_FIND_VERSION_EXACT or CUDA_FIND_VERSION is
-# specified. The presence of either of these options checks the version
-# string and signals if the version is acceptable or not.
-set(_cuda_version_acceptable TRUE)
-#
-if(CUDA_FIND_VERSION_EXACT AND NOT CUDA_VERSION VERSION_EQUAL CUDA_FIND_VERSION)
- set(_cuda_version_acceptable FALSE)
-endif()
-#
-if(CUDA_FIND_VERSION AND CUDA_VERSION VERSION_LESS CUDA_FIND_VERSION)
- set(_cuda_version_acceptable FALSE)
-endif()
-#
-if(NOT _cuda_version_acceptable)
- set(_cuda_error_message "Requested CUDA version ${CUDA_FIND_VERSION}, but found unacceptable version ${CUDA_VERSION}")
- if(CUDA_FIND_REQUIRED)
- message("${_cuda_error_message}")
- elseif(NOT CUDA_FIND_QUIETLY)
- message("${_cuda_error_message}")
- endif()
-endif()
-
# CUDA_TOOLKIT_INCLUDE
find_path(CUDA_TOOLKIT_INCLUDE
device_functions.h # Header included in toolkit
@@ -687,12 +664,14 @@ set(CUDA_SDK_ROOT_DIR_INTERNAL "${CUDA_SDK_ROOT_DIR}" CACHE INTERNAL
"This is the value of the last time CUDA_SDK_ROOT_DIR was set successfully." FORCE)
include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(CUDA DEFAULT_MSG
- CUDA_TOOLKIT_ROOT_DIR
- CUDA_NVCC_EXECUTABLE
- CUDA_INCLUDE_DIRS
- CUDA_CUDART_LIBRARY
- _cuda_version_acceptable
+find_package_handle_standard_args(CUDA
+ REQUIRED_VARS
+ CUDA_TOOLKIT_ROOT_DIR
+ CUDA_NVCC_EXECUTABLE
+ CUDA_INCLUDE_DIRS
+ CUDA_CUDART_LIBRARY
+ VERSION_VAR
+ CUDA_VERSION
)
diff --git a/Modules/FindFLEX.cmake b/Modules/FindFLEX.cmake
index f0f4a7b..55b5639 100644
--- a/Modules/FindFLEX.cmake
+++ b/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
diff --git a/Modules/FindJava.cmake b/Modules/FindJava.cmake
index eeb4778..1599433 100644
--- a/Modules/FindJava.cmake
+++ b/Modules/FindJava.cmake
@@ -13,6 +13,9 @@
# Java_VERSION_TWEAK = The tweak version of the package found (after '_')
# Java_VERSION = This is set to: $major.$minor.$patch(.$tweak)
#
+# The minimum required version of Java can be specified using the
+# standard CMake syntax, e.g. FIND_PACKAGE(Java 1.5)
+#
# NOTE: ${Java_VERSION} and ${Java_VERSION_STRING} are not guaranteed to be
# identical. For example some java version may return:
# Java_VERSION_STRING = 1.5.0_17
@@ -83,7 +86,6 @@ FIND_PROGRAM(Java_JAVA_EXECUTABLE
)
IF(Java_JAVA_EXECUTABLE)
- set(_java_version_acceptable TRUE)
EXECUTE_PROCESS(COMMAND ${Java_JAVA_EXECUTABLE} -version
RESULT_VARIABLE res
OUTPUT_VARIABLE var
@@ -114,7 +116,6 @@ IF(Java_JAVA_EXECUTABLE)
ELSE()
IF(NOT Java_FIND_QUIETLY)
message(WARNING "regex not supported: ${var}. Please report")
- set(_java_version_acceptable FALSE)
ENDIF(NOT Java_FIND_QUIETLY)
ENDIF()
STRING( REGEX REPLACE "([0-9]+).*" "\\1" Java_VERSION_MAJOR "${Java_VERSION_STRING}" )
@@ -134,17 +135,6 @@ IF(Java_JAVA_EXECUTABLE)
ENDIF(NOT Java_FIND_QUIETLY)
ENDIF()
- # check version if requested:
- if( Java_FIND_VERSION )
- if("${Java_VERSION}" VERSION_LESS "${Java_FIND_VERSION}")
- set(_java_version_acceptable FALSE)
- endif("${Java_VERSION}" VERSION_LESS "${Java_FIND_VERSION}")
- if( Java_FIND_VERSION_EXACT )
- if("${Java_VERSION}" VERSION_GREATER "${Java_FIND_VERSION}")
- set(_java_version_acceptable FALSE)
- endif("${Java_VERSION}" VERSION_GREATER "${Java_FIND_VERSION}")
- endif( Java_FIND_VERSION_EXACT )
- endif( Java_FIND_VERSION )
ENDIF(Java_JAVA_EXECUTABLE)
@@ -165,17 +155,15 @@ if(Java_FIND_COMPONENTS)
foreach(component ${Java_FIND_COMPONENTS})
# User just want to execute some Java byte-compiled
if(component STREQUAL "Runtime")
- find_package_handle_standard_args(Java DEFAULT_MSG
- Java_JAVA_EXECUTABLE
- _java_version_acceptable
- )
+ find_package_handle_standard_args(Java
+ REQUIRED_VARS Java_JAVA_EXECUTABLE
+ VERSION_VAR Java_VERSION
+ )
elseif(component STREQUAL "Development")
- find_package_handle_standard_args(Java DEFAULT_MSG
- Java_JAVA_EXECUTABLE
- Java_JAR_EXECUTABLE
- Java_JAVAC_EXECUTABLE
- _java_version_acceptable
- )
+ find_package_handle_standard_args(Java
+ REQUIRED_VARS Java_JAVA_EXECUTABLE Java_JAR_EXECUTABLE Java_JAVAC_EXECUTABLE
+ VERSION_VAR Java_VERSION
+ )
else()
message(FATAL_ERROR "Comp: ${component} is not handled")
endif()
@@ -183,12 +171,10 @@ if(Java_FIND_COMPONENTS)
endforeach(component)
else()
# Check for everything
- find_package_handle_standard_args(Java DEFAULT_MSG
- Java_JAVA_EXECUTABLE
- Java_JAR_EXECUTABLE
- Java_JAVAC_EXECUTABLE
- _java_version_acceptable
- )
+ find_package_handle_standard_args(Java
+ REQUIRED_VARS Java_JAVA_EXECUTABLE Java_JAR_EXECUTABLE Java_JAVAC_EXECUTABLE
+ VERSION_VAR Java_VERSION
+ )
endif()
diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake
index 1f6b7d0..37a55b3 100644
--- a/Modules/FindPackageHandleStandardArgs.cmake
+++ b/Modules/FindPackageHandleStandardArgs.cmake
@@ -214,7 +214,7 @@ FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG _VAR1)
ENDIF (${_NAME}_FIND_VERSION)
IF(VERSION_OK)
- SET(DETAILS "${DETAILS}[v${${VERSION}}]")
+ SET(DETAILS "${DETAILS}[v${VERSION}]")
ELSE(VERSION_OK)
SET(${_NAME_UPPER}_FOUND FALSE)
ENDIF(VERSION_OK)
diff --git a/Modules/FindPerlLibs.cmake b/Modules/FindPerlLibs.cmake
index eb4a904..d9b0e2b 100644
--- a/Modules/FindPerlLibs.cmake
+++ b/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})
diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake
index 2d1a125..2e78d85 100644
--- a/Modules/FindRuby.cmake
+++ b/Modules/FindRuby.cmake
@@ -1,7 +1,10 @@
# - Find Ruby
# This module finds if Ruby is installed and determines where the include files
-# and libraries are. Ruby 1.8 and 1.9 are supported. The minimum required version
-# specified in the find_package() command is honored.
+# and libraries are. Ruby 1.8 and 1.9 are supported.
+#
+# The minimum required version of Ruby can be specified using the
+# standard syntax, e.g. FIND_PACKAGE(Ruby 1.8)
+#
# It also determines what the name of the library is. This
# code sets the following variables:
#
@@ -154,22 +157,6 @@ SET(_RUBY_VERSION_SHORT "${RUBY_VERSION_MAJOR}.${RUBY_VERSION_MINOR}")
SET(_RUBY_VERSION_SHORT_NODOT "${RUBY_VERSION_MAJOR}${RUBY_VERSION_MINOR}")
SET(_RUBY_NODOT_VERSION "${RUBY_VERSION_MAJOR}${RUBY_VERSION_MINOR}${RUBY_VERSION_PATCH}")
-# Now we know which version we found
-IF(Ruby_FIND_VERSION)
- IF(${RUBY_VERSION} VERSION_LESS ${Ruby_FIND_VERSION})
- # force running ruby the next time again
- SET(RUBY_VERSION_MAJOR "" CACHE PATH "The Ruby major version" FORCE)
- IF(Ruby_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "Ruby version ${Ruby_FIND_VERSION} required, but only version ${RUBY_VERSION} found.")
- ELSE(Ruby_FIND_REQUIRED)
- IF(NOT Ruby_FIND_QUIETLY)
- MESSAGE(STATUS "Ruby version ${Ruby_FIND_VERSION} required, but only version ${RUBY_VERSION} found.")
- ENDIF(NOT Ruby_FIND_QUIETLY)
- RETURN()
- ENDIF(Ruby_FIND_REQUIRED)
- ENDIF(${RUBY_VERSION} VERSION_LESS ${Ruby_FIND_VERSION})
-ENDIF(Ruby_FIND_VERSION)
-
FIND_PATH(RUBY_INCLUDE_DIR
NAMES ruby.h
HINTS
@@ -240,7 +227,8 @@ IF(_RUBY_DEBUG_OUTPUT)
MESSAGE(STATUS "--------------------")
ENDIF(_RUBY_DEBUG_OUTPUT)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Ruby DEFAULT_MSG ${_RUBY_REQUIRED_VARS})
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Ruby REQUIRED_VARS ${_RUBY_REQUIRED_VARS}
+ VERSION_VAR RUBY_VERSION )
MARK_AS_ADVANCED(
RUBY_EXECUTABLE
diff --git a/Modules/FindSWIG.cmake b/Modules/FindSWIG.cmake
index b8c3b28..68a913d 100644
--- a/Modules/FindSWIG.cmake
+++ b/Modules/FindSWIG.cmake
@@ -5,6 +5,9 @@
# SWIG_EXECUTABLE - the path to the swig executable
# SWIG_VERSION - the version number of the swig executable
#
+# The minimum required version of SWIG can be specified using the
+# standard syntax, e.g. FIND_PACKAGE(SWIG 1.1)
+#
# All information is collected from the SWIG_EXECUTABLE so the
# version to be found can be changed from the command line by
# means of setting SWIG_EXECUTABLE
@@ -23,8 +26,6 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-SET(SWIG_FOUND FALSE)
-
FIND_PROGRAM(SWIG_EXECUTABLE swig)
IF(SWIG_EXECUTABLE)
@@ -45,7 +46,6 @@ IF(SWIG_EXECUTABLE)
SET(SWIG_DIR SWIG_DIR-NOTFOUND)
FIND_PATH(SWIG_DIR swig.swg PATHS ${SWIG_swiglib_output})
IF(SWIG_DIR)
- SET(SWIG_FOUND 1)
SET(SWIG_USE_FILE ${CMAKE_ROOT}/Modules/UseSWIG.cmake)
EXECUTE_PROCESS(COMMAND ${SWIG_EXECUTABLE} -version
OUTPUT_VARIABLE SWIG_version_output
@@ -62,12 +62,6 @@ IF(SWIG_EXECUTABLE)
ENDIF(SWIG_swiglib_result)
ENDIF(SWIG_EXECUTABLE)
-IF(NOT SWIG_FOUND)
- IF(NOT SWIG_FIND_QUIETLY)
- IF(SWIG_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "SWIG was not found. Please specify Swig executable location")
- ELSE(SWIG_FIND_REQUIRED)
- MESSAGE(STATUS "SWIG was not found. Please specify Swig executable location")
- ENDIF(SWIG_FIND_REQUIRED)
- ENDIF(NOT SWIG_FIND_QUIETLY)
-ENDIF(NOT SWIG_FOUND)
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(SWIG REQUIRED_VARS SWIG_EXECUTABLE SWIG_DIR
+ VERSION_VAR SWIG_VERSION )
diff --git a/Modules/FindSquish.cmake b/Modules/FindSquish.cmake
index a9ddf27..b0b6b2f 100644
--- a/Modules/FindSquish.cmake
+++ b/Modules/FindSquish.cmake
@@ -4,9 +4,6 @@
#
# ---- Variables and Macros
# SQUISH_FOUND If false, don't try to use Squish
-# SQUISH_VERSION_MAJOR The major version of Squish found
-# SQUISH_VERSION_MINOR The minor version of Squish found
-# SQUISH_VERSION_PATCH The patch version of Squish found
#
# SQUISH_INSTALL_DIR The Squish installation directory (containing bin, lib, etc)
# SQUISH_SERVER_EXECUTABLE The squishserver executable
diff --git a/Modules/FindSubversion.cmake b/Modules/FindSubversion.cmake
index 1bf7a4c..17fbeab 100644
--- a/Modules/FindSubversion.cmake
+++ b/Modules/FindSubversion.cmake
@@ -2,7 +2,12 @@
# The module defines the following variables:
# Subversion_SVN_EXECUTABLE - path to svn command line client
# Subversion_VERSION_SVN - version of svn command line client
-# Subversion_FOUND - true if the command line client was found
+# SUBVERSION_FOUND - true if the command line client was found
+# Subversion_FOUND - same as SUBVERSION_FOUND, kept around for compatibility
+#
+# The minimum required version of Subversion can be specified using the
+# standard syntax, e.g. FIND_PACKAGE(Subversion 1.4)
+#
# If the command line client executable is found the macro
# Subversion_WC_INFO(<dir> <var-prefix>)
# is defined to extract information of a subversion working copy at
@@ -17,12 +22,12 @@
# <var-prefix>_WC_INFO - output of command `svn info <dir>'
# Example usage:
# FIND_PACKAGE(Subversion)
-# IF(Subversion_FOUND)
+# IF(SUBVERSION_FOUND)
# Subversion_WC_INFO(${PROJECT_SOURCE_DIR} Project)
# MESSAGE("Current revision is ${Project_WC_REVISION}")
# Subversion_WC_LOG(${PROJECT_SOURCE_DIR} Project)
# MESSAGE("Last changed log is ${Project_LAST_CHANGED_LOG}")
-# ENDIF(Subversion_FOUND)
+# ENDIF(SUBVERSION_FOUND)
#=============================================================================
# Copyright 2006-2009 Kitware, Inc.
@@ -44,17 +49,19 @@ MARK_AS_ADVANCED(Subversion_SVN_EXECUTABLE)
IF(Subversion_SVN_EXECUTABLE)
+ EXECUTE_PROCESS(COMMAND ${Subversion_SVN_EXECUTABLE} --version
+ OUTPUT_VARIABLE Subversion_VERSION_SVN
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ STRING(REGEX REPLACE "^(.*\n)?svn, version ([.0-9]+).*"
+ "\\2" Subversion_VERSION_SVN "${Subversion_VERSION_SVN}")
+
MACRO(Subversion_WC_INFO dir prefix)
# the subversion commands should be executed with the C locale, otherwise
# the message (which are parsed) may be translated, Alex
SET(_Subversion_SAVED_LC_ALL "$ENV{LC_ALL}")
SET(ENV{LC_ALL} C)
- EXECUTE_PROCESS(COMMAND ${Subversion_SVN_EXECUTABLE} --version
- WORKING_DIRECTORY ${dir}
- OUTPUT_VARIABLE Subversion_VERSION_SVN
- OUTPUT_STRIP_TRAILING_WHITESPACE)
-
EXECUTE_PROCESS(COMMAND ${Subversion_SVN_EXECUTABLE} info ${dir}
OUTPUT_VARIABLE ${prefix}_WC_INFO
ERROR_VARIABLE Subversion_svn_info_error
@@ -65,8 +72,6 @@ IF(Subversion_SVN_EXECUTABLE)
MESSAGE(SEND_ERROR "Command \"${Subversion_SVN_EXECUTABLE} info ${dir}\" failed with output:\n${Subversion_svn_info_error}")
ELSE(NOT ${Subversion_svn_info_result} EQUAL 0)
- STRING(REGEX REPLACE "^(.*\n)?svn, version ([.0-9]+).*"
- "\\2" Subversion_VERSION_SVN "${Subversion_VERSION_SVN}")
STRING(REGEX REPLACE "^(.*\n)?URL: ([^\n]+).*"
"\\2" ${prefix}_WC_URL "${${prefix}_WC_INFO}")
STRING(REGEX REPLACE "^(.*\n)?Revision: ([^\n]+).*"
@@ -105,7 +110,8 @@ IF(Subversion_SVN_EXECUTABLE)
ENDIF(Subversion_SVN_EXECUTABLE)
INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Subversion DEFAULT_MSG Subversion_SVN_EXECUTABLE)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Subversion REQUIRED_VARS Subversion_SVN_EXECUTABLE
+ VERSION_VAR Subversion_VERSION_SVN )
# for compatibility
SET(Subversion_FOUND ${SUBVERSION_FOUND})