summaryrefslogtreecommitdiffstats
path: root/Modules/FindSWIG.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-08-10 18:51:45 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2010-08-10 18:51:45 (GMT)
commit74805b28c1f55a16310efe43465eb76c4e75f46a (patch)
tree327505f9f2820ca55d099625f387c52d29ac0f71 /Modules/FindSWIG.cmake
parent9cf9d2794c496213f84a78282d56c63763f732d6 (diff)
parent430336c5e1ae90903e3db228594b1c365c26f4a3 (diff)
downloadCMake-74805b28c1f55a16310efe43465eb76c4e75f46a.zip
CMake-74805b28c1f55a16310efe43465eb76c4e75f46a.tar.gz
CMake-74805b28c1f55a16310efe43465eb76c4e75f46a.tar.bz2
Merge topic 'ImprovedVersionCheckingInSomeModules'
430336c Merge branch 'findsubversion_fphsa_cleanup' b6c6156 Use FPHSA() in FindSWIG, including version checking. 656cd2f Improved version checking for FindCUDA using the new mode of FPHSA 126db7b Improved version checking for FindSubversion using the new mode of FPHSA() 77d909b Fix DETAILS string with version number in FHPSA() 19b68b9 Improved version checking for FindJava using the new FPHSA() mode 6bb0b6e Improved version checking for FindRuby using the new mode of FPHSA() 946493f FindSquish doesn't detect the version, remove that from the documentation cb9d1ea Add version checking support to FindFlex and FindPerlLibs
Diffstat (limited to 'Modules/FindSWIG.cmake')
-rw-r--r--Modules/FindSWIG.cmake18
1 files changed, 6 insertions, 12 deletions
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 )