From d07a4675d224d155b324fed5a6c43569835b5294 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Mon, 16 Jun 2008 15:19:44 -0400 Subject: [PATCH] ENH: fix find module stuff for test --- Modules/FindFLTK.cmake | 23 +++++++++++----------- Modules/FindKDE3.cmake | 12 +++++++---- Modules/FindMatlab.cmake | 4 +++- Tests/FindModulesExecuteAll/CMakeLists.txt | 1 + 4 files changed, 24 insertions(+), 16 deletions(-) diff --git a/Modules/FindFLTK.cmake b/Modules/FindFLTK.cmake index d16cf737f..1dc4a59b0 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 79d66ec49..7a48ac751 100644 --- a/Modules/FindKDE3.cmake +++ b/Modules/FindKDE3.cmake @@ -63,17 +63,21 @@ # # Author: Alexander Neundorf -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 17e6f367f..37619c22a 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 c9a6d6c2d..a2c55fc5a 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")