diff options
author | Alexander Neundorf <neundorf@kde.org> | 2007-07-19 13:00:51 (GMT) |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2007-07-19 13:00:51 (GMT) |
commit | c7770b8edbff442267563bd3036cef8fdb0cc4a9 (patch) | |
tree | 1c73f377e04981e72043a9ac5fff8fef0eca343b | |
parent | b6b1ebe2950e2437fffd4eecbe3f1992fc63e812 (diff) | |
download | CMake-c7770b8edbff442267563bd3036cef8fdb0cc4a9.zip CMake-c7770b8edbff442267563bd3036cef8fdb0cc4a9.tar.gz CMake-c7770b8edbff442267563bd3036cef8fdb0cc4a9.tar.bz2 |
ENH: use the new FIND_PACKAGE_HANDLE_STANDARD_ARGS() macro in most of the
not-too-complicated modules
-remove unnecessary default search paths used in the FIND_XXX() calls
Alex
-rw-r--r-- | Modules/FindASPELL.cmake | 18 | ||||
-rw-r--r-- | Modules/FindCURL.cmake | 29 | ||||
-rw-r--r-- | Modules/FindCurses.cmake | 42 | ||||
-rw-r--r-- | Modules/FindDCMTK.cmake | 28 | ||||
-rw-r--r-- | Modules/FindEXPAT.cmake | 28 | ||||
-rw-r--r-- | Modules/FindGLUT.cmake | 21 | ||||
-rw-r--r-- | Modules/FindGTK.cmake | 116 | ||||
-rw-r--r-- | Modules/FindGnuplot.cmake | 26 | ||||
-rw-r--r-- | Modules/FindHSPELL.cmake | 18 | ||||
-rw-r--r-- | Modules/FindMPEG.cmake | 20 | ||||
-rw-r--r-- | Modules/FindMPEG2.cmake | 40 | ||||
-rw-r--r-- | Modules/FindMotif.cmake | 16 | ||||
-rw-r--r-- | Modules/FindPerl.cmake | 21 | ||||
-rw-r--r-- | Modules/FindPhysFS.cmake | 34 | ||||
-rw-r--r-- | Modules/FindPike.cmake | 3 | ||||
-rw-r--r-- | Modules/FindPythonLibs.cmake | 180 | ||||
-rw-r--r-- | Modules/FindSDL.cmake | 42 | ||||
-rw-r--r-- | Modules/FindTCL.cmake | 2 | ||||
-rw-r--r-- | Modules/FindTclsh.cmake | 15 | ||||
-rw-r--r-- | Modules/FindWget.cmake | 14 | ||||
-rw-r--r-- | Modules/readme.txt | 7 |
21 files changed, 274 insertions, 446 deletions
diff --git a/Modules/FindASPELL.cmake b/Modules/FindASPELL.cmake index 978407d..583e5e8 100644 --- a/Modules/FindASPELL.cmake +++ b/Modules/FindASPELL.cmake @@ -21,20 +21,10 @@ FIND_PATH(ASPELL_INCLUDE_DIR aspell.h ) FIND_LIBRARY(ASPELL_LIBRARIES NAMES aspell aspell-15) -IF (ASPELL_INCLUDE_DIR AND ASPELL_LIBRARIES) - SET(ASPELL_FOUND TRUE) -ELSE (ASPELL_INCLUDE_DIR AND ASPELL_LIBRARIES) - SET(ASPELL_FOUND FALSE) -ENDIF (ASPELL_INCLUDE_DIR AND ASPELL_LIBRARIES) +# handle the QUIETLY and REQUIRED arguments and set ASPELL_FOUND to TRUE if +# all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(ASPELL ASPELL_LIBRARIES ASPELL_INCLUDE_DIR) -IF (ASPELL_FOUND) - IF (NOT ASPELL_FIND_QUIETLY) - MESSAGE(STATUS "Found ASPELL: ${ASPELL_LIBRARIES}") - ENDIF (NOT ASPELL_FIND_QUIETLY) -ELSE (ASPELL_FOUND) - IF (ASPELL_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Could NOT find ASPELL") - ENDIF (ASPELL_FIND_REQUIRED) -ENDIF (ASPELL_FOUND) MARK_AS_ADVANCED(ASPELL_INCLUDE_DIR ASPELL_LIBRARIES) diff --git a/Modules/FindCURL.cmake b/Modules/FindCURL.cmake index 37587ca..b079307 100644 --- a/Modules/FindCURL.cmake +++ b/Modules/FindCURL.cmake @@ -13,30 +13,15 @@ MARK_AS_ADVANCED(CURL_INCLUDE_DIR) FIND_LIBRARY(CURL_LIBRARY NAMES curl) MARK_AS_ADVANCED(CURL_LIBRARY) -# Copy the results to the output variables. -IF(CURL_INCLUDE_DIR AND CURL_LIBRARY) - SET(CURL_FOUND 1) +# handle the QUIETLY and REQUIRED arguments and set CURL_FOUND to TRUE if +# all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(CURL CURL_LIBRARY CURL_INCLUDE_DIR) + +IF(CURL_FOUND) SET(CURL_LIBRARIES ${CURL_LIBRARY}) SET(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR}) -ELSE(CURL_INCLUDE_DIR AND CURL_LIBRARY) - SET(CURL_FOUND 0) +ELSE(CURL_FOUND) SET(CURL_LIBRARIES) SET(CURL_INCLUDE_DIRS) -ENDIF(CURL_INCLUDE_DIR AND CURL_LIBRARY) - -# Report the results. -IF(CURL_FOUND) - IF(NOT CURL_FIND_QUIETLY) - MESSAGE(STATUS "CURL found: ${CURL_LIBRARIES}") - ENDIF(NOT CURL_FIND_QUIETLY) -ELSE(CURL_FOUND) - SET(CURL_DIR_MESSAGE - "CURL was not found. Make sure CURL_LIBRARY and CURL_INCLUDE_DIR are set.") - IF(CURL_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "${CURL_DIR_MESSAGE}") - ELSE(CURL_FIND_REQUIRED) - IF(NOT CURL_FIND_QUIETLY) - MESSAGE(STATUS "${CURL_DIR_MESSAGE}") - ENDIF(NOT CURL_FIND_QUIETLY) - ENDIF(CURL_FIND_REQUIRED) ENDIF(CURL_FOUND) diff --git a/Modules/FindCurses.cmake b/Modules/FindCurses.cmake index 9c72c49..b8bd3b1 100644 --- a/Modules/FindCurses.cmake +++ b/Modules/FindCurses.cmake @@ -1,35 +1,13 @@ # - Find the curses include file and library # -FIND_PATH(CURSES_INCLUDE_PATH - curses.h - /usr/local/include - /usr/include -) - -FIND_LIBRARY(CURSES_LIBRARY - NAMES curses ncurses - PATHS - /usr/local/lib - /usr/lib - /lib -) - -FIND_LIBRARY(CURSES_EXTRA_LIBRARY - cur_colr - PATHS - /usr/local/lib - /usr/lib - /lib -) - -FIND_LIBRARY(FORM_LIBRARY - form - PATHS - /usr/local/lib - /usr/lib - /lib -) +FIND_PATH(CURSES_INCLUDE_PATH curses.h ) + +FIND_LIBRARY(CURSES_LIBRARY NAMES curses ncurses ) + +FIND_LIBRARY(CURSES_EXTRA_LIBRARY cur_colr ) + +FIND_LIBRARY(FORM_LIBRARY form ) # Need to provide the *_LIBRARIES SET(CURSES_LIBRARIES ${CURSES_LIBRARY}) @@ -45,6 +23,12 @@ ENDIF(FORM_LIBRARY) # Proper name is *_INCLUDE_DIR SET(CURSES_INCLUDE_DIR ${CURSES_INCLUDE_PATH}) +# handle the QUIETLY and REQUIRED arguments and set CURSES_FOUND to TRUE if +# all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Curses CURSES_LIBRARY CURSES_INCLUDE_PATH) + + MARK_AS_ADVANCED( CURSES_INCLUDE_PATH CURSES_LIBRARY diff --git a/Modules/FindDCMTK.cmake b/Modules/FindDCMTK.cmake index 2a26334..5a35d24 100644 --- a/Modules/FindDCMTK.cmake +++ b/Modules/FindDCMTK.cmake @@ -74,13 +74,13 @@ ${DCMTK_DIR}/dcmnet/libsrc/ ) -IF( DCMTK_config_INCLUDE_DIR ) -IF( DCMTK_ofstd_INCLUDE_DIR ) -IF( DCMTK_ofstd_LIBRARY ) -IF( DCMTK_dcmdata_INCLUDE_DIR ) -IF( DCMTK_dcmdata_LIBRARY ) -IF( DCMTK_dcmimgle_INCLUDE_DIR ) -IF( DCMTK_dcmimgle_LIBRARY ) +IF( DCMTK_config_INCLUDE_DIR + AND DCMTK_ofstd_INCLUDE_DIR + AND DCMTK_ofstd_LIBRARY + AND DCMTK_dcmdata_INCLUDE_DIR + AND DCMTK_dcmdata_LIBRARY + AND DCMTK_dcmimgle_INCLUDE_DIR + AND DCMTK_dcmimgle_LIBRARY ) SET( DCMTK_FOUND "YES" ) SET( DCMTK_INCLUDE_DIR @@ -115,13 +115,13 @@ IF( DCMTK_dcmimgle_LIBRARY ) SET( DCMTK_LIBRARIES ${DCMTK_LIBRARIES} netapi32 ) ENDIF( WIN32 ) -ENDIF( DCMTK_dcmimgle_LIBRARY ) -ENDIF( DCMTK_dcmimgle_INCLUDE_DIR ) -ENDIF( DCMTK_dcmdata_LIBRARY ) -ENDIF( DCMTK_dcmdata_INCLUDE_DIR ) -ENDIF( DCMTK_ofstd_LIBRARY ) -ENDIF( DCMTK_ofstd_INCLUDE_DIR ) -ENDIF( DCMTK_config_INCLUDE_DIR ) +ENDIF( DCMTK_config_INCLUDE_DIR + AND DCMTK_ofstd_INCLUDE_DIR + AND DCMTK_ofstd_LIBRARY + AND DCMTK_dcmdata_INCLUDE_DIR + AND DCMTK_dcmdata_LIBRARY + AND DCMTK_dcmimgle_INCLUDE_DIR + AND DCMTK_dcmimgle_LIBRARY ) IF( NOT DCMTK_FOUND ) SET( DCMTK_DIR "" CACHE PATH "Root of DCMTK source tree (optional)." ) diff --git a/Modules/FindEXPAT.cmake b/Modules/FindEXPAT.cmake index d48eef3..d087966 100644 --- a/Modules/FindEXPAT.cmake +++ b/Modules/FindEXPAT.cmake @@ -7,32 +7,22 @@ # Look for the header file. FIND_PATH(EXPAT_INCLUDE_DIR NAMES expat.h) -MARK_AS_ADVANCED(EXPAT_INCLUDE_DIR) # Look for the library. FIND_LIBRARY(EXPAT_LIBRARY NAMES expat) -MARK_AS_ADVANCED(EXPAT_LIBRARY) + +# handle the QUIETLY and REQUIRED arguments and set EXPAT_FOUND to TRUE if +# all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(EXPAT EXPAT_LIBRARY EXPAT_INCLUDE_PATH) # Copy the results to the output variables. -IF(EXPAT_INCLUDE_DIR AND EXPAT_LIBRARY) - SET(EXPAT_FOUND 1) +IF(EXPAT_FOUND) SET(EXPAT_LIBRARIES ${EXPAT_LIBRARY}) SET(EXPAT_INCLUDE_DIRS ${EXPAT_INCLUDE_DIR}) -ELSE(EXPAT_INCLUDE_DIR AND EXPAT_LIBRARY) - SET(EXPAT_FOUND 0) +ELSE(EXPAT_FOUND) SET(EXPAT_LIBRARIES) SET(EXPAT_INCLUDE_DIRS) -ENDIF(EXPAT_INCLUDE_DIR AND EXPAT_LIBRARY) +ENDIF(EXPAT_FOUND) -# Report the results. -IF(NOT EXPAT_FOUND) - SET(EXPAT_DIR_MESSAGE - "EXPAT was not found. Make sure EXPAT_LIBRARY and EXPAT_INCLUDE_DIR are set.") - IF(NOT EXPAT_FIND_QUIETLY) - MESSAGE(STATUS "${EXPAT_DIR_MESSAGE}") - ELSE(NOT EXPAT_FIND_QUIETLY) - IF(EXPAT_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "${EXPAT_DIR_MESSAGE}") - ENDIF(EXPAT_FIND_REQUIRED) - ENDIF(NOT EXPAT_FIND_QUIETLY) -ENDIF(NOT EXPAT_FOUND) +MARK_AS_ADVANCED(EXPAT_INCLUDE_DIR EXPAT_LIBRARY) diff --git a/Modules/FindGLUT.cmake b/Modules/FindGLUT.cmake index f6fa551..ad1d5b5 100644 --- a/Modules/FindGLUT.cmake +++ b/Modules/FindGLUT.cmake @@ -11,16 +11,10 @@ IF (WIN32) IF(CYGWIN) - FIND_PATH( GLUT_INCLUDE_DIR GL/glut.h - /usr/include - ) + FIND_PATH( GLUT_INCLUDE_DIR GL/glut.h ) FIND_LIBRARY( GLUT_glut_LIBRARY glut32 ${OPENGL_LIBRARY_DIR} - /usr/lib - /usr/lib/w32api - /usr/local/lib - /usr/X11R6/lib ) @@ -50,36 +44,23 @@ ELSE (WIN32) ELSE (APPLE) FIND_PATH( GLUT_INCLUDE_DIR GL/glut.h - /usr/include /usr/include/GL - /usr/local/include /usr/openwin/share/include /usr/openwin/include - /usr/X11R6/include - /usr/include/X11 /opt/graphics/OpenGL/include /opt/graphics/OpenGL/contrib/libglut ) FIND_LIBRARY( GLUT_glut_LIBRARY glut - /usr/lib - /usr/local/lib /usr/openwin/lib - /usr/X11R6/lib ) FIND_LIBRARY( GLUT_Xi_LIBRARY Xi - /usr/lib - /usr/local/lib /usr/openwin/lib - /usr/X11R6/lib ) FIND_LIBRARY( GLUT_Xmu_LIBRARY Xmu - /usr/lib - /usr/local/lib /usr/openwin/lib - /usr/X11R6/lib ) ENDIF (APPLE) diff --git a/Modules/FindGTK.cmake b/Modules/FindGTK.cmake index b3cbe50..7d80241 100644 --- a/Modules/FindGTK.cmake +++ b/Modules/FindGTK.cmake @@ -7,16 +7,11 @@ # don't even bother under WIN32 IF(UNIX) - FIND_PATH( GTK_gtk_INCLUDE_PATH gtk/gtk.h - /usr/include - /usr/local/include + FIND_PATH( GTK_gtk_INCLUDE_PATH NAMES gtk/gtk.h + PATH_SUFFIXES gtk-1.2 gtk12 + PATHS /usr/openwin/share/include /usr/openwin/include - /usr/X11R6/include - /usr/include/X11 - /usr/X11R6/include/gtk12 - /usr/include/gtk-1.2 - /usr/local/include/gtk-1.2 /opt/gnome/include ) @@ -25,9 +20,8 @@ IF(UNIX) # for both. # - Atanas Georgiev <atanas@cs.columbia.edu> - FIND_PATH( GTK_glibconfig_INCLUDE_PATH glibconfig.h - /usr/include - /usr/local/include + FIND_PATH( GTK_glibconfig_INCLUDE_PATH NAMES glibconfig.h + PATHS /usr/openwin/share/include /usr/local/include/glib12 /usr/lib/glib/include @@ -36,31 +30,21 @@ IF(UNIX) /opt/gnome/lib/glib/include ) - FIND_PATH( GTK_glib_INCLUDE_PATH glib.h - /usr/include - /usr/local/include + FIND_PATH( GTK_glib_INCLUDE_PATH NAMES glib.h + PATH_SUFFIXES gtk-1.2 glib-1.2 glib12 + PATHS /usr/openwin/share/include - /usr/include/gtk-1.2 - /usr/local/include/glib12 /usr/lib/glib/include - /usr/include/glib-1.2 - /usr/local/include/glib-1.2 /opt/gnome/include - /opt/gnome/include/glib-1.2 ) - FIND_PATH( GTK_gtkgl_INCLUDE_PATH gtkgl/gtkglarea.h - /usr/include - /usr/local/include - /usr/openwin/share/include - /opt/gnome/include + FIND_PATH( GTK_gtkgl_INCLUDE_PATH NAMES gtkgl/gtkglarea.h + PATHS /usr/openwin/share/include + /opt/gnome/include ) FIND_LIBRARY( GTK_gtkgl_LIBRARY gtkgl - /usr/lib - /usr/local/lib /usr/openwin/lib - /usr/X11R6/lib /opt/gnome/lib ) @@ -70,63 +54,45 @@ IF(UNIX) FIND_LIBRARY( GTK_gtk_LIBRARY NAMES gtk gtk12 - PATHS /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib + PATHS /usr/openwin/lib /opt/gnome/lib ) FIND_LIBRARY( GTK_gdk_LIBRARY NAMES gdk gdk12 - PATHS /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib + PATHS /usr/openwin/lib /opt/gnome/lib ) FIND_LIBRARY( GTK_gmodule_LIBRARY NAMES gmodule gmodule12 - PATHS /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib + PATHS /usr/openwin/lib /opt/gnome/lib ) FIND_LIBRARY( GTK_glib_LIBRARY NAMES glib glib12 - PATHS /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib + PATHS /usr/openwin/lib /opt/gnome/lib ) FIND_LIBRARY( GTK_Xi_LIBRARY NAMES Xi - PATHS /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib - /opt/gnome/lib + PATHS /usr/openwin/lib + /opt/gnome/lib ) FIND_LIBRARY( GTK_gthread_LIBRARY NAMES gthread gthread12 - PATHS /usr/lib - /usr/local/lib - /usr/openwin/lib - /usr/X11R6/lib + PATHS /usr/openwin/lib /opt/gnome/lib ) - IF(GTK_gtk_INCLUDE_PATH) - IF(GTK_glibconfig_INCLUDE_PATH) - IF(GTK_glib_INCLUDE_PATH) - IF(GTK_gtk_LIBRARY) - IF(GTK_glib_LIBRARY) + IF(GTK_gtk_INCLUDE_PATH + AND GTK_glibconfig_INCLUDE_PATH + AND GTK_glib_INCLUDE_PATH + AND GTK_gtk_LIBRARY + AND GTK_glib_LIBRARY) # Assume that if gtk and glib were found, the other # supporting libraries have also been found. @@ -149,24 +115,22 @@ IF(UNIX) SET(GTK_LIBRARIES ${GTK_LIBRARIES} ${GTK_Xi_LIBRARY}) ENDIF(GTK_Xi_LIBRARY) - IF(GTK_gtkgl_INCLUDE_PATH) - IF(GTK_gtkgl_LIBRARY) - SET( GTK_GL_FOUND "YES" ) - SET( GTK_INCLUDE_DIR ${GTK_INCLUDE_DIR} - ${GTK_gtkgl_INCLUDE_PATH} ) - SET( GTK_LIBRARIES ${GTK_gtkgl_LIBRARY} ${GTK_LIBRARIES} ) - MARK_AS_ADVANCED( - GTK_gtkgl_LIBRARY - GTK_gtkgl_INCLUDE_PATH - ) - ENDIF(GTK_gtkgl_LIBRARY) - ENDIF(GTK_gtkgl_INCLUDE_PATH) - - ENDIF(GTK_glib_LIBRARY) - ENDIF(GTK_gtk_LIBRARY) - ENDIF(GTK_glib_INCLUDE_PATH) - ENDIF(GTK_glibconfig_INCLUDE_PATH) - ENDIF(GTK_gtk_INCLUDE_PATH) + IF(GTK_gtkgl_INCLUDE_PATH AND GTK_gtkgl_LIBRARY) + SET( GTK_GL_FOUND "YES" ) + SET( GTK_INCLUDE_DIR ${GTK_INCLUDE_DIR} + ${GTK_gtkgl_INCLUDE_PATH} ) + SET( GTK_LIBRARIES ${GTK_gtkgl_LIBRARY} ${GTK_LIBRARIES} ) + MARK_AS_ADVANCED( + GTK_gtkgl_LIBRARY + GTK_gtkgl_INCLUDE_PATH + ) + ENDIF(GTK_gtkgl_INCLUDE_PATH AND GTK_gtkgl_LIBRARY) + + ENDIF(GTK_gtk_INCLUDE_PATH + AND GTK_glibconfig_INCLUDE_PATH + AND GTK_glib_INCLUDE_PATH + AND GTK_gtk_LIBRARY + AND GTK_glib_LIBRARY) MARK_AS_ADVANCED( GTK_gdk_LIBRARY @@ -184,3 +148,5 @@ IF(UNIX) ENDIF(UNIX) + + diff --git a/Modules/FindGnuplot.cmake b/Modules/FindGnuplot.cmake index 5e3babc..2de1b16 100644 --- a/Modules/FindGnuplot.cmake +++ b/Modules/FindGnuplot.cmake @@ -1,20 +1,28 @@ # - this module looks for gnuplot # +# Once done this will define +# +# GNUPLOT_FOUND - system has Gnuplot +# GNUPLOT_EXECUTABLE - the Gnuplot executable INCLUDE(FindCygwin) -FIND_PROGRAM(GNUPLOT +FIND_PROGRAM(GNUPLOT_EXECUTABLE NAMES gnuplot pgnuplot wgnupl32 - PATH + PATHS ${CYGWIN_INSTALL_PATH}/bin - /bin - /usr/bin - /usr/local/bin - /sbin -) -MARK_AS_ADVANCED( - GNUPLOT ) + +# for compatibility +SET(GNUPLOT ${GNUPLOT_EXECUTABLE}) + +# handle the QUIETLY and REQUIRED arguments and set GNUPLOT_FOUND to TRUE if +# all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Gnuplot GNUPLOT_EXECUTABLE) + +MARK_AS_ADVANCED( GNUPLOT_EXECUTABLE ) + diff --git a/Modules/FindHSPELL.cmake b/Modules/FindHSPELL.cmake index a2b93a7..b016258 100644 --- a/Modules/FindHSPELL.cmake +++ b/Modules/FindHSPELL.cmake @@ -22,21 +22,11 @@ FIND_PATH(HSPELL_INCLUDE_DIR hspell.h ) FIND_LIBRARY(HSPELL_LIBRARIES NAMES hspell ) -IF (HSPELL_INCLUDE_DIR AND HSPELL_LIBRARIES) - SET(HSPELL_FOUND TRUE) -ELSE (HSPELL_INCLUDE_DIR AND HSPELL_LIBRARIES) - SET(HSPELL_FOUND FALSE) -ENDIF (HSPELL_INCLUDE_DIR AND HSPELL_LIBRARIES) +# handle the QUIETLY and REQUIRED arguments and set HSPELL_FOUND to TRUE if +# all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(HSPELL HSPELL_LIBRARIES HSPELL_INCLUDE_DIR) -IF (HSPELL_FOUND) - IF (NOT HSPELL_FIND_QUIETLY) - MESSAGE(STATUS "Found HSPELL: ${HSPELL_LIBRARIES}") - ENDIF (NOT HSPELL_FIND_QUIETLY) -ELSE (HSPELL_FOUND) - IF (HSPELL_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Could NOT find HSPELL") - ENDIF (HSPELL_FIND_REQUIRED) -ENDIF (HSPELL_FOUND) MARK_AS_ADVANCED(HSPELL_INCLUDE_DIR HSPELL_LIBRARIES) diff --git a/Modules/FindMPEG.cmake b/Modules/FindMPEG.cmake index 225b243..5437b21 100644 --- a/Modules/FindMPEG.cmake +++ b/Modules/FindMPEG.cmake @@ -8,28 +8,22 @@ # MPEG_vo_LIBRARY, where to find the vo library. FIND_PATH(MPEG_INCLUDE_DIR mpeg2dec/include/video_out.h - /usr/local/include - /usr/include /usr/local/livid ) FIND_LIBRARY(MPEG_mpeg2_LIBRARY mpeg2 - /usr/local/lib - /usr/lib /usr/local/livid/mpeg2dec/libmpeg2/.libs ) FIND_LIBRARY( MPEG_vo_LIBRARY vo - /usr/local/lib - /usr/lib /usr/local/livid/mpeg2dec/libvo/.libs ) -SET( MPEG_FOUND "NO" ) -IF(MPEG_INCLUDE_DIR) - IF(MPEG_mpeg2_LIBRARY) - SET( MPEG_FOUND "YES" ) - SET( MPEG_LIBRARIES ${MPEG_mpeg2_LIBRARY} ${MPEG_vo_LIBRARY} ) - ENDIF(MPEG_mpeg2_LIBRARY) -ENDIF(MPEG_INCLUDE_DIR) +# handle the QUIETLY and REQUIRED arguments and set MPEG2_FOUND to TRUE if +# all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(MPEG MPEG_INCLUDE_DIR MPEG_mpeg2_LIBRARY) +IF(MPEG_FOUND) + SET( MPEG_LIBRARIES ${MPEG_mpeg2_LIBRARY} ${MPEG_vo_LIBRARY} ) +ENDIF(MPEG_FOUND) diff --git a/Modules/FindMPEG2.cmake b/Modules/FindMPEG2.cmake index 4b54fe3..06dd137 100644 --- a/Modules/FindMPEG2.cmake +++ b/Modules/FindMPEG2.cmake @@ -8,36 +8,32 @@ # MPEG2_vo_LIBRARY, where to find the vo library. FIND_PATH(MPEG2_INCLUDE_DIR mpeg2.h - /usr/local/include - /usr/include /usr/local/livid ) FIND_LIBRARY(MPEG2_mpeg2_LIBRARY mpeg2 - /usr/local/lib - /usr/lib /usr/local/livid/mpeg2dec/libmpeg2/.libs ) FIND_LIBRARY( MPEG2_vo_LIBRARY vo - /usr/local/lib - /usr/lib /usr/local/livid/mpeg2dec/libvo/.libs ) -SET( MPEG2_FOUND "NO" ) -IF(MPEG2_INCLUDE_DIR) - IF(MPEG2_mpeg2_LIBRARY) - SET( MPEG2_FOUND "YES" ) - SET( MPEG2_LIBRARIES ${MPEG2_mpeg2_LIBRARY} - ${MPEG2_vo_LIBRARY}) - - #some native mpeg2 installations will depend - #on libSDL, if found, add it in. - INCLUDE( ${MODULE_PATH}/NewCMake/FindSDL.cmake ) - IF(SDL_FOUND) - SET( MPEG2_LIBRARIES ${MPEG2_LIBRARIES} ${SDL_LIBRARY}) - ENDIF(SDL_FOUND) - - ENDIF(MPEG2_mpeg2_LIBRARY) -ENDIF(MPEG2_INCLUDE_DIR) + +# handle the QUIETLY and REQUIRED arguments and set MPEG2_FOUND to TRUE if +# all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(MPEG2 MPEG2_mpeg2_LIBRARY MPEG2_INCLUDE_DIR) + +IF(MPEG2_FOUND) + SET( MPEG2_LIBRARIES ${MPEG2_mpeg2_LIBRARY} + ${MPEG2_vo_LIBRARY}) + + #some native mpeg2 installations will depend + #on libSDL, if found, add it in. + INCLUDE( FindSDL.cmake ) + IF(SDL_FOUND) + SET( MPEG2_LIBRARIES ${MPEG2_LIBRARIES} ${SDL_LIBRARY}) + ENDIF(SDL_FOUND) +ENDIF(MPEG2_FOUND) + diff --git a/Modules/FindMotif.cmake b/Modules/FindMotif.cmake index 5c3871f..d5f83de 100644 --- a/Modules/FindMotif.cmake +++ b/Modules/FindMotif.cmake @@ -5,28 +5,26 @@ # MOTIF_LIBRARIES - Link these to use Motif SET(MOTIF_FOUND 0) + IF(UNIX) FIND_PATH(MOTIF_INCLUDE_DIR Xm/Xm.h - /usr/X11R6/include - /usr/local/include /usr/openwin/include - /usr/include ) FIND_LIBRARY(MOTIF_LIBRARIES Xm - /usr/X11R6/lib - /usr/local/lib /usr/openwin/lib - /usr/lib ) - IF(MOTIF_LIBRARIES AND MOTIF_INCLUDE_DIR) - SET(MOTIF_FOUND 1) - ENDIF(MOTIF_LIBRARIES AND MOTIF_INCLUDE_DIR) ENDIF(UNIX) +# handle the QUIETLY and REQUIRED arguments and set MOTIF_FOUND to TRUE if +# all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Motif MOTIF_LIBRARIES MOTIF_INCLUDE_DIR) + + MARK_AS_ADVANCED( MOTIF_INCLUDE_DIR MOTIF_LIBRARIES diff --git a/Modules/FindPerl.cmake b/Modules/FindPerl.cmake index 1af301d..5772883 100644 --- a/Modules/FindPerl.cmake +++ b/Modules/FindPerl.cmake @@ -14,20 +14,13 @@ FIND_PROGRAM(PERL_EXECUTABLE ${CYGWIN_INSTALL_PATH}/bin ) -MARK_AS_ADVANCED( - PERL_EXECUTABLE - ) - -IF (NOT PERL_EXECUTABLE) - SET(PERL_FOUND "NO") -ELSE (NOT PERL_EXECUTABLE) - SET(PERL_FOUND "YES") - # Deprecated settings for compatibility with CMake1.4 - SET (PERL ${PERL_EXECUTABLE}) -ENDIF (NOT PERL_EXECUTABLE) +# Deprecated settings for compatibility with CMake1.4 +SET (PERL ${PERL_EXECUTABLE}) +# handle the QUIETLY and REQUIRED arguments and set PERL_FOUND to TRUE if +# all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Perl PERL_EXECUTABLE) -IF (NOT PERL_FOUND AND Perl_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Could not find Perl") -ENDIF (NOT PERL_FOUND AND Perl_FIND_REQUIRED) +MARK_AS_ADVANCED( PERL_EXECUTABLE ) diff --git a/Modules/FindPhysFS.cmake b/Modules/FindPhysFS.cmake index 5912234..93750c2 100644 --- a/Modules/FindPhysFS.cmake +++ b/Modules/FindPhysFS.cmake @@ -14,23 +14,15 @@ # On OSX, this will prefer the Framework version (if found) over others. # People will have to manually change the cache values of # PHYSFS_LIBRARY to override this selection. -FIND_PATH(PHYSFS_INCLUDE_DIR physfs.h + +FIND_PATH(PHYSFS_INCLUDE_DIR NAMES physfs.h + PATH_SUFFIXES physfs + PATHS $ENV{PHYSFSDIR}/include ~/Library/Frameworks/PhysFS.framework/Headers /Library/Frameworks/PhysFS.framework/Headers - /usr/local/include/physfs - /usr/local/include - /usr/include/physfs - /usr/include - /sw/include/physfs # Fink - /sw/include - /opt/local/include/physfs # DarwinPorts - /opt/local/include - /opt/csw/include/physfs # Blastwave - /opt/csw/include - /opt/include/physfs - /opt/include ) + # I'm not sure if I should do a special casing for Apple. It is # unlikely that other Unix systems will find the framework path. # But if they do ([Next|Open|GNU]Step?), @@ -58,17 +50,11 @@ ELSE(${PHYSFS_INCLUDE_DIR} MATCHES ".framework") NAMES physfs PhysFS PATHS $ENV{PHYSFSDIR}/lib - /usr/local/lib - /usr/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib ) -ENDIF(${PHYSFS_INCLUDE_DIR} MATCHES ".framework") -SET(PHYSFS_FOUND "NO") -IF(PHYSFS_LIBRARY) - SET(PHYSFS_FOUND "YES") -ENDIF(PHYSFS_LIBRARY) +ENDIF(${PHYSFS_INCLUDE_DIR} MATCHES ".framework") +# handle the QUIETLY and REQUIRED arguments and set PHYSFS_FOUND to TRUE if +# all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(PhysFS PHYSFS_LIBRARY PHYSFS_INCLUDE_DIR) diff --git a/Modules/FindPike.cmake b/Modules/FindPike.cmake index c0db37d..12985e8 100644 --- a/Modules/FindPike.cmake +++ b/Modules/FindPike.cmake @@ -16,9 +16,6 @@ FIND_PATH(PIKE_INCLUDE_PATH program.h FIND_PROGRAM(PIKE_EXECUTABLE NAMES pike7.4 - PATHS - /usr/bin - /usr/local/bin ) MARK_AS_ADVANCED( diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake index 9e9b7d0..17f004a 100644 --- a/Modules/FindPythonLibs.cmake +++ b/Modules/FindPythonLibs.cmake @@ -10,110 +10,53 @@ # INCLUDE(CMakeFindFrameworks) +# Search for the python framework on Apple. +CMAKE_FIND_FRAMEWORKS(Python) + +FOREACH(_CURRENT_VERSION 2.5 2.4 2.3 2.2 2.1 2.0 1.6 1.5) + STRING(REPLACE "." "" _CURRENT_VERSION_NO_DOTS ${_CURRENT_VERSION}) + IF(WIN32) + FIND_LIBRARY(PYTHON_DEBUG_LIBRARY + NAMES python${_CURRENT_VERSION_NO_DOTS}_d python + PATHS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs ) + ENDIF(WIN32) -IF(WIN32) - FIND_LIBRARY(PYTHON_DEBUG_LIBRARY - NAMES python25_d python24_d python23_d python22_d python21_d python20_d python + FIND_LIBRARY(PYTHON_LIBRARY + NAMES python${_CURRENT_VERSION_NO_DOTS} python${_CURRENT_VERSION} PATHS - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath]/libs/Debug - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath]/libs - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]/libs/Debug - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]/libs - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]/libs/Debug - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]/libs - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.2\\InstallPath]/libs/Debug - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.2\\InstallPath]/libs - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.1\\InstallPath]/libs/Debug - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.1\\InstallPath]/libs - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.0\\InstallPath]/libs/Debug - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.0\\InstallPath]/libs - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\1.6\\InstallPath]/libs/Debug - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\1.6\\InstallPath]/libs - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\1.5\\InstallPath]/libs/Debug - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\1.5\\InstallPath]/libs + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs + PATH_SUFFIXES + python${_CURRENT_VERSION}/config + # Avoid finding the .dll in the PATH. We want the .lib. + NO_SYSTEM_ENVIRONMENT_PATH ) -ENDIF(WIN32) - -FIND_LIBRARY(PYTHON_LIBRARY - NAMES python25 python2.5 - python24 python2.4 - python23 python2.3 - python22 python2.2 - python21 python2.1 - python20 python2.0 - python16 python1.6 - python15 python1.5 - - PATHS - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath]/libs - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]/libs - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]/libs - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.2\\InstallPath]/libs - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.1\\InstallPath]/libs - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.0\\InstallPath]/libs - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\1.6\\InstallPath]/libs - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\1.5\\InstallPath]/libs - - PATH_SUFFIXES - python2.5/config - python2.4/config - python2.3/config - python2.2/config - python2.1/config - python2.0/config - python1.6/config - python1.5/config - - # Avoid finding the .dll in the PATH. We want the .lib. - NO_SYSTEM_ENVIRONMENT_PATH -) - -# Search for the python framework on Apple. -CMAKE_FIND_FRAMEWORKS(Python) -SET(PYTHON_FRAMEWORK_INCLUDES) -IF(Python_FRAMEWORKS) - IF(NOT PYTHON_INCLUDE_PATH) - FOREACH(version 2.5 2.4 2.3 2.2 2.1 2.0 1.6 1.5) - FOREACH(dir ${Python_FRAMEWORKS}) - SET(PYTHON_FRAMEWORK_INCLUDES ${PYTHON_FRAMEWORK_INCLUDES} - ${dir}/Versions/${version}/include/python${version}) - ENDFOREACH(dir) - ENDFOREACH(version) - ENDIF(NOT PYTHON_INCLUDE_PATH) -ENDIF(Python_FRAMEWORKS) -FIND_PATH(PYTHON_INCLUDE_PATH - NAMES Python.h - - PATHS - ${PYTHON_FRAMEWORK_INCLUDES} - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath]/include - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]/include - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]/include - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.2\\InstallPath]/include - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.1\\InstallPath]/include - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.0\\InstallPath]/include - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\1.6\\InstallPath]/include - [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\1.5\\InstallPath]/include - - PATH_SUFFIXES - python2.5 - python2.4 - python2.3 - python2.2 - python2.1 - python2.0 - python1.6 - python1.5 -) + SET(PYTHON_FRAMEWORK_INCLUDES) + IF(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_PATH) + FOREACH(dir ${Python_FRAMEWORKS}) + SET(PYTHON_FRAMEWORK_INCLUDES ${PYTHON_FRAMEWORK_INCLUDES} + ${dir}/Versions/${_CURRENT_VERSION}/include/python${_CURRENT_VERSION}) + ENDFOREACH(dir) + ENDIF(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_PATH) -IF (WIN32) - MARK_AS_ADVANCED( - PYTHON_DEBUG_LIBRARY - PYTHON_LIBRARY - PYTHON_INCLUDE_PATH + FIND_PATH(PYTHON_INCLUDE_PATH + NAMES Python.h + PATHS + ${PYTHON_FRAMEWORK_INCLUDES} + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include + PATH_SUFFIXES + python${_CURRENT_VERSION} ) -ENDIF(WIN32) + +ENDFOREACH(_CURRENT_VERSION) + +MARK_AS_ADVANCED( + PYTHON_DEBUG_LIBRARY + PYTHON_LIBRARY + PYTHON_INCLUDE_PATH +) # Python Should be built and installed as a Framework on OSX IF(Python_FRAMEWORKS) @@ -141,3 +84,44 @@ SET(PYTHON_DEBUG_LIBRARIES "${PYTHON_DEBUG_LIBRARY}") INCLUDE(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibs PYTHON_LIBRARIES PYTHON_INCLUDE_PATH) + +MACRO(PYTHON_ADD_MODULE _NAME ) + OPTION(PYTHON_ENABLE_MODULE_${_NAME} "Add module ${_NAME}" TRUE) + + IF(PYTHON_ENABLE_MODULE_${_NAME}) + OPTION(PYTHON_MODULE_${_NAME}_SHARED "Add module ${_NAME} shared" FALSE) + IF(PYTHON_MODULE_${_NAME}_SHARED) + SET(PY_MODULE_TYPE MODULE) + ELSE(PYTHON_MODULE_${_NAME}_SHARED) + SET(PY_MODULE_TYPE STATIC) + ENDIF(PYTHON_MODULE_${_NAME}_SHARED) + + SET(PY_MODULES_LIST ${PY_MODULES_LIST} ${_NAME}) + ADD_LIBRARY(${_NAME} ${PY_MODULE_TYPE} ${ARGN}) + TARGET_LINK_LIBRARIES(${_NAME} ${PYTHON_LIBRARIES}) + ENDIF(PYTHON_ENABLE_MODULE_${_NAME}) +ENDMACRO(PYTHON_ADD_MODULE) + +MACRO(PYTHON_WRITE_MODULES_HEADER _filename) + GET_FILENAME_COMPONENT(_name "${_filename}" NAME) + STRING(REPLACE "." "_" _name "${_name}") + STRING(TOUPPER ${_name} _name) + FILE(WRITE ${_filename} "/*Created by cmake, do not edit, changes will be lost*/\n") + FILE(APPEND ${_filename} "#ifndef ${_name}\n") + FILE(APPEND ${_filename} "#define ${_name}\n\n") + FILE(APPEND ${_filename} "#include <Python.h>\n\n") + + FOREACH(_currentModule ${PY_MODULES_LIST}) + FILE(APPEND ${_filename} "extern void init${_currentModule}(void);\n\n") + ENDFOREACH(_currentModule ${PY_MODULES_LIST}) + + FOREACH(_currentModule ${PY_MODULES_LIST}) + FILE(APPEND ${_filename} "int CMakeLoadPythonModule_${_currentModule}(void) \n{\n return PyImport_AppendInittab(\"${_currentModule}\", init${_currentModule});\n}\n\n") + ENDFOREACH(_currentModule ${PY_MODULES_LIST}) + + FILE(APPEND ${_filename} "#ifndef EXCLUDE_LOAD_ALL_FUNCTION\nvoid CMakeLoadAllPythonModules(void)\n{\n") + FOREACH(_currentModule ${PY_MODULES_LIST}) + FILE(APPEND ${_filename} " CMakeLoadPythonModule_${_currentModule}();\n") + ENDFOREACH(_currentModule ${PY_MODULES_LIST}) + FILE(APPEND ${_filename} "}\n#endif\n\n#endif\n") +ENDMACRO(PYTHON_WRITE_MODULES_HEADER) diff --git a/Modules/FindSDL.cmake b/Modules/FindSDL.cmake index 62766d6..b43bed3 100644 --- a/Modules/FindSDL.cmake +++ b/Modules/FindSDL.cmake @@ -29,27 +29,15 @@ # This needed to change because "proper" SDL convention # is #include "SDL.h", not <SDL/SDL.h>. This is done for portability # reasons because not all systems place things in SDL/ (see FreeBSD). -FIND_PATH(SDL_INCLUDE_DIR SDL.h + +FIND_PATH(SDL_INCLUDE_DIR NAMES SDL.h + PATH_SUFFIXES SDL SDL12 SDL11 + PATHS $ENV{SDLDIR}/include ~/Library/Frameworks/SDL.framework/Headers /Library/Frameworks/SDL.framework/Headers - /usr/local/include/SDL - /usr/include/SDL - /usr/local/include/SDL12 - /usr/local/include/SDL11 # FreeBSD ports - /usr/include/SDL12 - /usr/include/SDL11 - /usr/local/include - /usr/include - /sw/include/SDL # Fink - /sw/include - /opt/local/include/SDL # DarwinPorts - /opt/local/include - /opt/csw/include/SDL # Blastwave - /opt/csw/include - /opt/include/SDL - /opt/include ) + # I'm not sure if I should do a special casing for Apple. It is # unlikely that other Unix systems will find the framework path. # But if they do ([Next|Open|GNU]Step?), @@ -86,13 +74,8 @@ ELSE(${SDL_INCLUDE_DIR} MATCHES ".framework") NAMES SDL SDL-1.1 PATHS $ENV{SDLDIR}/lib - /usr/local/lib - /usr/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib ) + # Non-OS X framework versions expect you to also dynamically link to # SDLmain. This is mainly for Windows and OS X. Other platforms # seem to provide SDLmain for compatibility even though they don't @@ -101,12 +84,6 @@ ELSE(${SDL_INCLUDE_DIR} MATCHES ".framework") NAMES SDLmain SDLmain-1.1 PATHS $ENV{SDLDIR}/lib - /usr/local/lib - /usr/lib - /sw/lib - /opt/local/lib - /opt/csw/lib - /opt/lib ) ENDIF(${SDL_INCLUDE_DIR} MATCHES ".framework") @@ -125,7 +102,6 @@ IF(MINGW) SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW") ENDIF(MINGW) -SET(SDL_FOUND "NO") IF(SDL_LIBRARY_TEMP) # For SDLmain IF(SDLMAIN_LIBRARY) @@ -156,7 +132,11 @@ IF(SDL_LIBRARY_TEMP) # Set the final string here so the GUI reflects the final state. SET(SDL_LIBRARY ${SDL_LIBRARY_TEMP} CACHE STRING "Where the SDL Library can be found") - SET(SDL_FOUND "YES") ENDIF(SDL_LIBRARY_TEMP) +# handle the QUIETLY and REQUIRED arguments and set SDL_FOUND to TRUE if +# all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL SDL_LIBRARY_TEMP) + MARK_AS_ADVANCED(SDL_LIBRARY_TEMP) diff --git a/Modules/FindTCL.cmake b/Modules/FindTCL.cmake index b0ee79b..2099e27 100644 --- a/Modules/FindTCL.cmake +++ b/Modules/FindTCL.cmake @@ -35,6 +35,8 @@ SET (TCLTK_POSSIBLE_LIB_PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.3;Root]/lib [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/lib [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/lib + /usr/lib + /usr/local/lib ) FIND_LIBRARY(TCL_LIBRARY diff --git a/Modules/FindTclsh.cmake b/Modules/FindTclsh.cmake index 4bacc0f..ce358c1 100644 --- a/Modules/FindTclsh.cmake +++ b/Modules/FindTclsh.cmake @@ -2,14 +2,14 @@ # This module finds if TCL is installed and determines where the # include files and libraries are. It also determines what the name of # the library is. This code sets the following variables: +# TCLSH_FOUND = TRUE if tclsh has been found # TCL_TCLSH = the path to the tclsh executable # In cygwin, look for the cygwin version first. Don't look for it later to # avoid finding the cygwin version on a Win32 build. -IF(WIN32) - IF(UNIX) - FIND_PROGRAM(TCL_TCLSH NAMES cygtclsh83 cygtclsh80) - ENDIF(UNIX) -ENDIF(WIN32) + +IF(WIN32 AND UNIX) + FIND_PROGRAM(TCL_TCLSH NAMES cygtclsh83 cygtclsh80) +ENDIF(WIN32 AND UNIX) GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH) GET_FILENAME_COMPONENT(TK_LIBRARY_PATH "${TK_LIBRARY}" PATH) @@ -32,4 +32,9 @@ FIND_PROGRAM(TCL_TCLSH [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/bin ) +# handle the QUIETLY and REQUIRED arguments and set TIFF_FOUND to TRUE if +# all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Tclsh TCL_TCLSH) + MARK_AS_ADVANCED( TCL_TCLSH ) diff --git a/Modules/FindWget.cmake b/Modules/FindWget.cmake index 9c9e257..edf3396 100644 --- a/Modules/FindWget.cmake +++ b/Modules/FindWget.cmake @@ -11,16 +11,12 @@ FIND_PROGRAM(WGET_EXECUTABLE ${CYGWIN_INSTALL_PATH}/bin ) -IF (WGET_EXECUTABLE) - SET(WGET_FOUND "Yes") -ELSE (WGET_EXECUTABLE) - SET(WGET_FOUND "No") -ENDIF (WGET_EXECUTABLE) +# handle the QUIETLY and REQUIRED arguments and set WGET_FOUND to TRUE if +# all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Wget WGET_EXECUTABLE) - -MARK_AS_ADVANCED( - WGET_EXECUTABLE -) +MARK_AS_ADVANCED( WGET_EXECUTABLE ) # WGET option is deprecated. # use WGET_EXECUTABLE instead. diff --git a/Modules/readme.txt b/Modules/readme.txt index 2e63011..632c054 100644 --- a/Modules/readme.txt +++ b/Modules/readme.txt @@ -53,7 +53,7 @@ For example: # # It even needs to paragraphs to tell you about it. # And it defines the following variables: -# VAR_COOL - this is greate isn't it? +# VAR_COOL - this is great isn't it? # VAR_REALLY_COOL - cool right? # @@ -68,7 +68,7 @@ A FindXXX.cmake module will typically be loaded by the command If the QUIET option is given to the command it will set the variable XXX_FIND_QUIETLY to true before loading the FindXXX.cmake module. If this variable is set the module should not complain about not being -able to find the package and should never issue a FATAL_ERROR. If the +able to find the package. If the REQUIRED option is given to the command it will set the variable XXX_FIND_REQUIRED to true before loading the FindXXX.cmake module. If this variable is set the module should issue a FATAL_ERROR if the @@ -80,3 +80,6 @@ module to determine which sub-components of the package must be found. If neither the QUIET nor REQUIRED options are given then the FindXXX.cmake module should look for the package and complain without error if the module is not found. + +To get this behaviour you can use the FIND_PACKAGE_HANDLE_STANDARD_ARGS() +macro, as an example see FindJPEG.cmake. |