summaryrefslogtreecommitdiffstats
path: root/Modules/FindSWIG.cmake
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2004-06-28 13:08:13 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2004-06-28 13:08:13 (GMT)
commit0beaf4cb4e5728756e6bee2d19c5821c3b06b216 (patch)
tree30d7eb75a7b7dac1f1011e2ec409f1cb6d19ca7e /Modules/FindSWIG.cmake
parent3860a2dcd68d52a248e2befb09945aff3f8fa9f2 (diff)
downloadCMake-0beaf4cb4e5728756e6bee2d19c5821c3b06b216.zip
CMake-0beaf4cb4e5728756e6bee2d19c5821c3b06b216.tar.gz
CMake-0beaf4cb4e5728756e6bee2d19c5821c3b06b216.tar.bz2
BUG: Replace MATCHES with STREQUAL for better checking, better checking for existence of swig directory, verify if required flag was set, support fedora's location of swig. Fixes Bug #955 - Swig on fedora and Bug #954 - FIND_PACKAGE(SWIG REQUIRED)
Diffstat (limited to 'Modules/FindSWIG.cmake')
-rw-r--r--Modules/FindSWIG.cmake20
1 files changed, 13 insertions, 7 deletions
diff --git a/Modules/FindSWIG.cmake b/Modules/FindSWIG.cmake
index 0403aa7..0932a8c 100644
--- a/Modules/FindSWIG.cmake
+++ b/Modules/FindSWIG.cmake
@@ -2,15 +2,17 @@ SET(SWIG_FOUND FOOBAR)
FIND_PATH(SWIG_DIR
SWIGConfig.cmake
/usr/share/swig1.3
+ /usr/lib/swig1.3
/usr/local/share/swig1.3)
FIND_PATH(SWIG_DIR
swig.swg
/usr/share/swig1.3
+ /usr/lib/swig1.3
/usr/local/share/swig1.3)
IF(EXISTS ${SWIG_DIR})
- IF("x${SWIG_DIR}x" MATCHES "^x${CMAKE_ROOT}/Modulesx$")
+ IF("x${SWIG_DIR}x" STREQUAL "x${CMAKE_ROOT}/Modulesx")
MESSAGE("SWIG_DIR should not be modules subdirectory of CMake")
- ENDIF("x${SWIG_DIR}x" MATCHES "^x${CMAKE_ROOT}/Modulesx$")
+ ENDIF("x${SWIG_DIR}x" STREQUAL "x${CMAKE_ROOT}/Modulesx")
IF(EXISTS ${SWIG_DIR}/SWIGConfig.cmake)
INCLUDE(${SWIG_DIR}/SWIGConfig.cmake)
@@ -22,14 +24,18 @@ IF(EXISTS ${SWIG_DIR})
ENDIF(EXISTS ${SWIG_DIR}/SWIGConfig.cmake)
ENDIF(EXISTS ${SWIG_DIR})
-IF("x${SWIG_FOUND}x" MATCHES "^xFOOBARx$")
+IF("x${SWIG_FOUND}x" STREQUAL "xFOOBARx")
SET(SWIG_FOUND 0)
- IF(SWIG_DIR)
+ IF(EXISTS ${SWIG_DIR})
IF(EXISTS ${SWIG_USE_FILE})
IF(EXISTS ${SWIG_EXECUTABLE})
SET(SWIG_FOUND 1)
ENDIF(EXISTS ${SWIG_EXECUTABLE})
ENDIF(EXISTS ${SWIG_USE_FILE})
- ENDIF(SWIG_DIR)
-ENDIF("x${SWIG_FOUND}x" MATCHES "^xFOOBARx$")
-
+ ENDIF(EXISTS ${SWIG_DIR})
+ IF(NOT ${SWIG_FOUND})
+ IF(${SWIG_FIND_REQUIRED})
+ MESSAGE(FATAL_ERROR "Swig was not found on the system. Please specify the location of Swig.")
+ ENDIF(${SWIG_FIND_REQUIRED})
+ ENDIF(NOT ${SWIG_FOUND})
+ENDIF("x${SWIG_FOUND}x" STREQUAL "xFOOBARx")