diff options
author | Alex Neundorf <neundorf@kde.org> | 2010-08-07 21:18:17 (GMT) |
---|---|---|
committer | Alex Neundorf <neundorf@kde.org> | 2010-08-07 21:18:17 (GMT) |
commit | b6c61561d6cc646e4503b5e27ddd34944a0d6e11 (patch) | |
tree | 606288e6581621d12f83943a59dd374d2cb50511 /Modules/FindSWIG.cmake | |
parent | 656cd2fad284970107c691053422d9bf362be068 (diff) | |
download | CMake-b6c61561d6cc646e4503b5e27ddd34944a0d6e11.zip CMake-b6c61561d6cc646e4503b5e27ddd34944a0d6e11.tar.gz CMake-b6c61561d6cc646e4503b5e27ddd34944a0d6e11.tar.bz2 |
Use FPHSA() in FindSWIG, including version checking.
Alex
Diffstat (limited to 'Modules/FindSWIG.cmake')
-rw-r--r-- | Modules/FindSWIG.cmake | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/Modules/FindSWIG.cmake b/Modules/FindSWIG.cmake index 6edcb72..76e44bc 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 distributed 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 ) |