summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2008-06-16 19:19:44 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2008-06-16 19:19:44 (GMT)
commitd07a4675d224d155b324fed5a6c43569835b5294 (patch)
tree2644be79b4190659e61d1f4a295837c260dad3bd
parent6c97713a271ddd3de95a9cc130bbf46906c9a172 (diff)
downloadCMake-d07a4675d224d155b324fed5a6c43569835b5294.zip
CMake-d07a4675d224d155b324fed5a6c43569835b5294.tar.gz
CMake-d07a4675d224d155b324fed5a6c43569835b5294.tar.bz2
ENH: fix find module stuff for test
-rw-r--r--Modules/FindFLTK.cmake23
-rw-r--r--Modules/FindKDE3.cmake12
-rw-r--r--Modules/FindMatlab.cmake4
-rw-r--r--Tests/FindModulesExecuteAll/CMakeLists.txt1
4 files changed, 24 insertions, 16 deletions
diff --git a/Modules/FindFLTK.cmake b/Modules/FindFLTK.cmake
index d16cf73..1dc4a59 100644
--- a/Modules/FindFLTK.cmake
+++ b/Modules/FindFLTK.cmake
@@ -11,6 +11,11 @@
# FLTK_FORMS_LIBRARY = the full path to fltk_forms.lib
# FLTK_IMAGES_LIBRARY = the full path to fltk_images.lib
+IF (FLTK_INCLUDE_DIR)
+ # Already in cache, be silent
+ SET(FLTK_FIND_QUIETLY TRUE)
+ENDIF (FLTK_INCLUDE_DIR)
+
# Platform dependent libraries required by FLTK
IF(WIN32)
IF(NOT CYGWIN)
@@ -24,7 +29,8 @@ ENDIF(WIN32)
IF(UNIX)
INCLUDE(${CMAKE_ROOT}/Modules/FindX11.cmake)
- SET( FLTK_PLATFORM_DEPENDENT_LIBS ${X11_LIBRARIES} -lm)
+ FIND_LIBRARY(FLTK_MATH_LIBRARY m)
+ SET( FLTK_PLATFORM_DEPENDENT_LIBS ${X11_LIBRARIES} ${FLTK_MATH_LIBRARY})
ENDIF(UNIX)
IF(APPLE)
@@ -32,7 +38,8 @@ IF(APPLE)
ENDIF(APPLE)
IF(CYGWIN)
- SET( FLTK_PLATFORM_DEPENDENT_LIBS ole32 uuid comctl32 wsock32 supc++ -lm -lgdi32)
+ FIND_LIBRARY(FLTK_MATH_LIBRARY m)
+ SET( FLTK_PLATFORM_DEPENDENT_LIBS ole32 uuid comctl32 wsock32 supc++ ${FLTK_MATH_LIBRARY} -lgdi32)
ENDIF(CYGWIN)
# If FLTK_INCLUDE_DIR is already defined we assigne its value to FLTK_DIR
@@ -96,10 +103,6 @@ IF(NOT FLTK_DIR)
)
ENDIF(NOT FLTK_DIR)
-# If FLTK was found, load the configuration file to get the rest of the
-# settings.
-IF(FLTK_DIR)
-
# Check if FLTK was built using CMake
IF(EXISTS ${FLTK_DIR}/FLTKConfig.cmake)
SET(FLTK_BUILT_WITH_CMAKE 1)
@@ -170,8 +173,6 @@ IF(FLTK_DIR)
ENDIF(FLTK_FLUID_EXECUTABLE)
SET(FLTK_INCLUDE_SEARCH_PATH ${FLTK_INCLUDE_SEARCH_PATH}
- /usr/local/include
- /usr/include
/usr/local/fltk
/usr/X11R6/include
)
@@ -179,8 +180,6 @@ IF(FLTK_DIR)
FIND_PATH(FLTK_INCLUDE_DIR FL/Fl.h ${FLTK_INCLUDE_SEARCH_PATH})
SET(FLTK_LIBRARY_SEARCH_PATH ${FLTK_LIBRARY_SEARCH_PATH}
- /usr/lib
- /usr/local/lib
/usr/local/fltk/lib
/usr/X11R6/lib
${FLTK_INCLUDE_DIR}/lib
@@ -215,7 +214,6 @@ IF(FLTK_DIR)
ENDIF(UNIX)
ENDIF(FLTK_BUILT_WITH_CMAKE)
-ENDIF(FLTK_DIR)
SET(FLTK_FOUND 1)
@@ -242,3 +240,6 @@ IF(FLTK_FOUND)
SET (FLTK_FLUID_EXE ${FLTK_FLUID_EXECUTABLE})
SET (FLTK_LIBRARY ${FLTK_LIBRARIES})
ENDIF(FLTK_FOUND)
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(FLTK DEFAULT_MSG FLTK_LIBRARIES FLTK_INCLUDE_DIR)
diff --git a/Modules/FindKDE3.cmake b/Modules/FindKDE3.cmake
index 79d66ec..7a48ac7 100644
--- a/Modules/FindKDE3.cmake
+++ b/Modules/FindKDE3.cmake
@@ -63,17 +63,21 @@
#
# Author: Alexander Neundorf <neundorf@kde.org>
-IF(NOT UNIX)
+IF(NOT UNIX AND KDE3_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Compiling KDE3 applications and libraries under Windows is not supported")
-ENDIF(NOT UNIX)
+ENDIF(NOT UNIX AND KDE3_FIND_REQUIRED)
SET(QT_MT_REQUIRED TRUE)
#SET(QT_MIN_VERSION "3.0.0")
#this line includes FindQt.cmake, which searches the Qt library and headers
-FIND_PACKAGE(Qt3 REQUIRED)
-FIND_PACKAGE(X11 REQUIRED)
+IF(KDE3_FIND_REQUIRED)
+ SET(_REQ_STRING_KDE3 "REQUIRED")
+ENDIF(KDE3_FIND_REQUIRED)
+
+FIND_PACKAGE(Qt3 ${_REQ_STRING_KDE3})
+FIND_PACKAGE(X11 ${_REQ_STRING_KDE3})
#add some KDE specific stuff
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake
index 17e6f36..37619c2 100644
--- a/Modules/FindMatlab.cmake
+++ b/Modules/FindMatlab.cmake
@@ -21,7 +21,9 @@ IF(WIN32)
# Same here, there are also: bcc50 and bcc51 directories
SET(MATLAB_ROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/lib/win32/microsoft/bcc54")
ELSE(${CMAKE_GENERATOR} MATCHES "Borland")
- MESSAGE(FATAL_ERROR "Generator not compatible: ${CMAKE_GENERATOR}")
+ IF(MATLAB_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Generator not compatible: ${CMAKE_GENERATOR}")
+ ENDIF(MATLAB_FIND_REQUIRED)
ENDIF(${CMAKE_GENERATOR} MATCHES "Borland")
ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio 7")
ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
diff --git a/Tests/FindModulesExecuteAll/CMakeLists.txt b/Tests/FindModulesExecuteAll/CMakeLists.txt
index c9a6d6c..a2c55fc 100644
--- a/Tests/FindModulesExecuteAll/CMakeLists.txt
+++ b/Tests/FindModulesExecuteAll/CMakeLists.txt
@@ -7,6 +7,7 @@
# I guess more things could be added, like checking whether variables are
# defined after running the modules (e.g. FOO_FOUND etc.).
+cmake_minimum_required(VERSION 2.7)
file(GLOB all_modules "${CMAKE_CURRENT_SOURCE_DIR}/../../Modules/Find*cmake")