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
This commit is contained in:
Alexander Neundorf 2007-07-19 09:00:51 -04:00
parent b6b1ebe295
commit c7770b8edb
21 changed files with 269 additions and 441 deletions

View File

@ -21,20 +21,10 @@ FIND_PATH(ASPELL_INCLUDE_DIR aspell.h )
FIND_LIBRARY(ASPELL_LIBRARIES NAMES aspell aspell-15) FIND_LIBRARY(ASPELL_LIBRARIES NAMES aspell aspell-15)
IF (ASPELL_INCLUDE_DIR AND ASPELL_LIBRARIES) # handle the QUIETLY and REQUIRED arguments and set ASPELL_FOUND to TRUE if
SET(ASPELL_FOUND TRUE) # all listed variables are TRUE
ELSE (ASPELL_INCLUDE_DIR AND ASPELL_LIBRARIES) INCLUDE(FindPackageHandleStandardArgs)
SET(ASPELL_FOUND FALSE) FIND_PACKAGE_HANDLE_STANDARD_ARGS(ASPELL ASPELL_LIBRARIES ASPELL_INCLUDE_DIR)
ENDIF (ASPELL_INCLUDE_DIR AND ASPELL_LIBRARIES)
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) MARK_AS_ADVANCED(ASPELL_INCLUDE_DIR ASPELL_LIBRARIES)

View File

@ -13,30 +13,15 @@ MARK_AS_ADVANCED(CURL_INCLUDE_DIR)
FIND_LIBRARY(CURL_LIBRARY NAMES curl) FIND_LIBRARY(CURL_LIBRARY NAMES curl)
MARK_AS_ADVANCED(CURL_LIBRARY) MARK_AS_ADVANCED(CURL_LIBRARY)
# Copy the results to the output variables. # handle the QUIETLY and REQUIRED arguments and set CURL_FOUND to TRUE if
IF(CURL_INCLUDE_DIR AND CURL_LIBRARY) # all listed variables are TRUE
SET(CURL_FOUND 1) INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CURL CURL_LIBRARY CURL_INCLUDE_DIR)
IF(CURL_FOUND)
SET(CURL_LIBRARIES ${CURL_LIBRARY}) SET(CURL_LIBRARIES ${CURL_LIBRARY})
SET(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR}) SET(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR})
ELSE(CURL_INCLUDE_DIR AND CURL_LIBRARY) ELSE(CURL_FOUND)
SET(CURL_FOUND 0)
SET(CURL_LIBRARIES) SET(CURL_LIBRARIES)
SET(CURL_INCLUDE_DIRS) 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) ENDIF(CURL_FOUND)

View File

@ -1,35 +1,13 @@
# - Find the curses include file and library # - Find the curses include file and library
# #
FIND_PATH(CURSES_INCLUDE_PATH FIND_PATH(CURSES_INCLUDE_PATH curses.h )
curses.h
/usr/local/include
/usr/include
)
FIND_LIBRARY(CURSES_LIBRARY FIND_LIBRARY(CURSES_LIBRARY NAMES curses ncurses )
NAMES curses ncurses
PATHS
/usr/local/lib
/usr/lib
/lib
)
FIND_LIBRARY(CURSES_EXTRA_LIBRARY FIND_LIBRARY(CURSES_EXTRA_LIBRARY cur_colr )
cur_colr
PATHS
/usr/local/lib
/usr/lib
/lib
)
FIND_LIBRARY(FORM_LIBRARY FIND_LIBRARY(FORM_LIBRARY form )
form
PATHS
/usr/local/lib
/usr/lib
/lib
)
# Need to provide the *_LIBRARIES # Need to provide the *_LIBRARIES
SET(CURSES_LIBRARIES ${CURSES_LIBRARY}) SET(CURSES_LIBRARIES ${CURSES_LIBRARY})
@ -45,6 +23,12 @@ ENDIF(FORM_LIBRARY)
# Proper name is *_INCLUDE_DIR # Proper name is *_INCLUDE_DIR
SET(CURSES_INCLUDE_DIR ${CURSES_INCLUDE_PATH}) 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( MARK_AS_ADVANCED(
CURSES_INCLUDE_PATH CURSES_INCLUDE_PATH
CURSES_LIBRARY CURSES_LIBRARY

View File

@ -74,13 +74,13 @@ ${DCMTK_DIR}/dcmnet/libsrc/
) )
IF( DCMTK_config_INCLUDE_DIR ) IF( DCMTK_config_INCLUDE_DIR
IF( DCMTK_ofstd_INCLUDE_DIR ) AND DCMTK_ofstd_INCLUDE_DIR
IF( DCMTK_ofstd_LIBRARY ) AND DCMTK_ofstd_LIBRARY
IF( DCMTK_dcmdata_INCLUDE_DIR ) AND DCMTK_dcmdata_INCLUDE_DIR
IF( DCMTK_dcmdata_LIBRARY ) AND DCMTK_dcmdata_LIBRARY
IF( DCMTK_dcmimgle_INCLUDE_DIR ) AND DCMTK_dcmimgle_INCLUDE_DIR
IF( DCMTK_dcmimgle_LIBRARY ) AND DCMTK_dcmimgle_LIBRARY )
SET( DCMTK_FOUND "YES" ) SET( DCMTK_FOUND "YES" )
SET( DCMTK_INCLUDE_DIR SET( DCMTK_INCLUDE_DIR
@ -115,13 +115,13 @@ IF( DCMTK_dcmimgle_LIBRARY )
SET( DCMTK_LIBRARIES ${DCMTK_LIBRARIES} netapi32 ) SET( DCMTK_LIBRARIES ${DCMTK_LIBRARIES} netapi32 )
ENDIF( WIN32 ) ENDIF( WIN32 )
ENDIF( DCMTK_dcmimgle_LIBRARY ) ENDIF( DCMTK_config_INCLUDE_DIR
ENDIF( DCMTK_dcmimgle_INCLUDE_DIR ) AND DCMTK_ofstd_INCLUDE_DIR
ENDIF( DCMTK_dcmdata_LIBRARY ) AND DCMTK_ofstd_LIBRARY
ENDIF( DCMTK_dcmdata_INCLUDE_DIR ) AND DCMTK_dcmdata_INCLUDE_DIR
ENDIF( DCMTK_ofstd_LIBRARY ) AND DCMTK_dcmdata_LIBRARY
ENDIF( DCMTK_ofstd_INCLUDE_DIR ) AND DCMTK_dcmimgle_INCLUDE_DIR
ENDIF( DCMTK_config_INCLUDE_DIR ) AND DCMTK_dcmimgle_LIBRARY )
IF( NOT DCMTK_FOUND ) IF( NOT DCMTK_FOUND )
SET( DCMTK_DIR "" CACHE PATH "Root of DCMTK source tree (optional)." ) SET( DCMTK_DIR "" CACHE PATH "Root of DCMTK source tree (optional)." )

View File

@ -7,32 +7,22 @@
# Look for the header file. # Look for the header file.
FIND_PATH(EXPAT_INCLUDE_DIR NAMES expat.h) FIND_PATH(EXPAT_INCLUDE_DIR NAMES expat.h)
MARK_AS_ADVANCED(EXPAT_INCLUDE_DIR)
# Look for the library. # Look for the library.
FIND_LIBRARY(EXPAT_LIBRARY NAMES expat) 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. # Copy the results to the output variables.
IF(EXPAT_INCLUDE_DIR AND EXPAT_LIBRARY) IF(EXPAT_FOUND)
SET(EXPAT_FOUND 1)
SET(EXPAT_LIBRARIES ${EXPAT_LIBRARY}) SET(EXPAT_LIBRARIES ${EXPAT_LIBRARY})
SET(EXPAT_INCLUDE_DIRS ${EXPAT_INCLUDE_DIR}) SET(EXPAT_INCLUDE_DIRS ${EXPAT_INCLUDE_DIR})
ELSE(EXPAT_INCLUDE_DIR AND EXPAT_LIBRARY) ELSE(EXPAT_FOUND)
SET(EXPAT_FOUND 0)
SET(EXPAT_LIBRARIES) SET(EXPAT_LIBRARIES)
SET(EXPAT_INCLUDE_DIRS) SET(EXPAT_INCLUDE_DIRS)
ENDIF(EXPAT_INCLUDE_DIR AND EXPAT_LIBRARY) ENDIF(EXPAT_FOUND)
# Report the results. MARK_AS_ADVANCED(EXPAT_INCLUDE_DIR EXPAT_LIBRARY)
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)

View File

@ -11,16 +11,10 @@ IF (WIN32)
IF(CYGWIN) IF(CYGWIN)
FIND_PATH( GLUT_INCLUDE_DIR GL/glut.h FIND_PATH( GLUT_INCLUDE_DIR GL/glut.h )
/usr/include
)
FIND_LIBRARY( GLUT_glut_LIBRARY glut32 FIND_LIBRARY( GLUT_glut_LIBRARY glut32
${OPENGL_LIBRARY_DIR} ${OPENGL_LIBRARY_DIR}
/usr/lib
/usr/lib/w32api
/usr/local/lib
/usr/X11R6/lib
) )
@ -50,36 +44,23 @@ ELSE (WIN32)
ELSE (APPLE) ELSE (APPLE)
FIND_PATH( GLUT_INCLUDE_DIR GL/glut.h FIND_PATH( GLUT_INCLUDE_DIR GL/glut.h
/usr/include
/usr/include/GL /usr/include/GL
/usr/local/include
/usr/openwin/share/include /usr/openwin/share/include
/usr/openwin/include /usr/openwin/include
/usr/X11R6/include
/usr/include/X11
/opt/graphics/OpenGL/include /opt/graphics/OpenGL/include
/opt/graphics/OpenGL/contrib/libglut /opt/graphics/OpenGL/contrib/libglut
) )
FIND_LIBRARY( GLUT_glut_LIBRARY glut FIND_LIBRARY( GLUT_glut_LIBRARY glut
/usr/lib
/usr/local/lib
/usr/openwin/lib /usr/openwin/lib
/usr/X11R6/lib
) )
FIND_LIBRARY( GLUT_Xi_LIBRARY Xi FIND_LIBRARY( GLUT_Xi_LIBRARY Xi
/usr/lib
/usr/local/lib
/usr/openwin/lib /usr/openwin/lib
/usr/X11R6/lib
) )
FIND_LIBRARY( GLUT_Xmu_LIBRARY Xmu FIND_LIBRARY( GLUT_Xmu_LIBRARY Xmu
/usr/lib
/usr/local/lib
/usr/openwin/lib /usr/openwin/lib
/usr/X11R6/lib
) )
ENDIF (APPLE) ENDIF (APPLE)

View File

@ -7,16 +7,11 @@
# don't even bother under WIN32 # don't even bother under WIN32
IF(UNIX) IF(UNIX)
FIND_PATH( GTK_gtk_INCLUDE_PATH gtk/gtk.h FIND_PATH( GTK_gtk_INCLUDE_PATH NAMES gtk/gtk.h
/usr/include PATH_SUFFIXES gtk-1.2 gtk12
/usr/local/include PATHS
/usr/openwin/share/include /usr/openwin/share/include
/usr/openwin/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 /opt/gnome/include
) )
@ -25,9 +20,8 @@ IF(UNIX)
# for both. # for both.
# - Atanas Georgiev <atanas@cs.columbia.edu> # - Atanas Georgiev <atanas@cs.columbia.edu>
FIND_PATH( GTK_glibconfig_INCLUDE_PATH glibconfig.h FIND_PATH( GTK_glibconfig_INCLUDE_PATH NAMES glibconfig.h
/usr/include PATHS
/usr/local/include
/usr/openwin/share/include /usr/openwin/share/include
/usr/local/include/glib12 /usr/local/include/glib12
/usr/lib/glib/include /usr/lib/glib/include
@ -36,31 +30,21 @@ IF(UNIX)
/opt/gnome/lib/glib/include /opt/gnome/lib/glib/include
) )
FIND_PATH( GTK_glib_INCLUDE_PATH glib.h FIND_PATH( GTK_glib_INCLUDE_PATH NAMES glib.h
/usr/include PATH_SUFFIXES gtk-1.2 glib-1.2 glib12
/usr/local/include PATHS
/usr/openwin/share/include /usr/openwin/share/include
/usr/include/gtk-1.2
/usr/local/include/glib12
/usr/lib/glib/include /usr/lib/glib/include
/usr/include/glib-1.2
/usr/local/include/glib-1.2
/opt/gnome/include /opt/gnome/include
/opt/gnome/include/glib-1.2
) )
FIND_PATH( GTK_gtkgl_INCLUDE_PATH gtkgl/gtkglarea.h FIND_PATH( GTK_gtkgl_INCLUDE_PATH NAMES gtkgl/gtkglarea.h
/usr/include PATHS /usr/openwin/share/include
/usr/local/include /opt/gnome/include
/usr/openwin/share/include
/opt/gnome/include
) )
FIND_LIBRARY( GTK_gtkgl_LIBRARY gtkgl FIND_LIBRARY( GTK_gtkgl_LIBRARY gtkgl
/usr/lib
/usr/local/lib
/usr/openwin/lib /usr/openwin/lib
/usr/X11R6/lib
/opt/gnome/lib /opt/gnome/lib
) )
@ -70,63 +54,45 @@ IF(UNIX)
FIND_LIBRARY( GTK_gtk_LIBRARY FIND_LIBRARY( GTK_gtk_LIBRARY
NAMES gtk gtk12 NAMES gtk gtk12
PATHS /usr/lib PATHS /usr/openwin/lib
/usr/local/lib
/usr/openwin/lib
/usr/X11R6/lib
/opt/gnome/lib /opt/gnome/lib
) )
FIND_LIBRARY( GTK_gdk_LIBRARY FIND_LIBRARY( GTK_gdk_LIBRARY
NAMES gdk gdk12 NAMES gdk gdk12
PATHS /usr/lib PATHS /usr/openwin/lib
/usr/local/lib
/usr/openwin/lib
/usr/X11R6/lib
/opt/gnome/lib /opt/gnome/lib
) )
FIND_LIBRARY( GTK_gmodule_LIBRARY FIND_LIBRARY( GTK_gmodule_LIBRARY
NAMES gmodule gmodule12 NAMES gmodule gmodule12
PATHS /usr/lib PATHS /usr/openwin/lib
/usr/local/lib
/usr/openwin/lib
/usr/X11R6/lib
/opt/gnome/lib /opt/gnome/lib
) )
FIND_LIBRARY( GTK_glib_LIBRARY FIND_LIBRARY( GTK_glib_LIBRARY
NAMES glib glib12 NAMES glib glib12
PATHS /usr/lib PATHS /usr/openwin/lib
/usr/local/lib
/usr/openwin/lib
/usr/X11R6/lib
/opt/gnome/lib /opt/gnome/lib
) )
FIND_LIBRARY( GTK_Xi_LIBRARY FIND_LIBRARY( GTK_Xi_LIBRARY
NAMES Xi NAMES Xi
PATHS /usr/lib PATHS /usr/openwin/lib
/usr/local/lib /opt/gnome/lib
/usr/openwin/lib
/usr/X11R6/lib
/opt/gnome/lib
) )
FIND_LIBRARY( GTK_gthread_LIBRARY FIND_LIBRARY( GTK_gthread_LIBRARY
NAMES gthread gthread12 NAMES gthread gthread12
PATHS /usr/lib PATHS /usr/openwin/lib
/usr/local/lib
/usr/openwin/lib
/usr/X11R6/lib
/opt/gnome/lib /opt/gnome/lib
) )
IF(GTK_gtk_INCLUDE_PATH) IF(GTK_gtk_INCLUDE_PATH
IF(GTK_glibconfig_INCLUDE_PATH) AND GTK_glibconfig_INCLUDE_PATH
IF(GTK_glib_INCLUDE_PATH) AND GTK_glib_INCLUDE_PATH
IF(GTK_gtk_LIBRARY) AND GTK_gtk_LIBRARY
IF(GTK_glib_LIBRARY) AND GTK_glib_LIBRARY)
# Assume that if gtk and glib were found, the other # Assume that if gtk and glib were found, the other
# supporting libraries have also been found. # supporting libraries have also been found.
@ -149,24 +115,22 @@ IF(UNIX)
SET(GTK_LIBRARIES ${GTK_LIBRARIES} ${GTK_Xi_LIBRARY}) SET(GTK_LIBRARIES ${GTK_LIBRARIES} ${GTK_Xi_LIBRARY})
ENDIF(GTK_Xi_LIBRARY) ENDIF(GTK_Xi_LIBRARY)
IF(GTK_gtkgl_INCLUDE_PATH) IF(GTK_gtkgl_INCLUDE_PATH AND GTK_gtkgl_LIBRARY)
IF(GTK_gtkgl_LIBRARY) SET( GTK_GL_FOUND "YES" )
SET( GTK_GL_FOUND "YES" ) SET( GTK_INCLUDE_DIR ${GTK_INCLUDE_DIR}
SET( GTK_INCLUDE_DIR ${GTK_INCLUDE_DIR} ${GTK_gtkgl_INCLUDE_PATH} )
${GTK_gtkgl_INCLUDE_PATH} ) SET( GTK_LIBRARIES ${GTK_gtkgl_LIBRARY} ${GTK_LIBRARIES} )
SET( GTK_LIBRARIES ${GTK_gtkgl_LIBRARY} ${GTK_LIBRARIES} ) MARK_AS_ADVANCED(
MARK_AS_ADVANCED( GTK_gtkgl_LIBRARY
GTK_gtkgl_LIBRARY GTK_gtkgl_INCLUDE_PATH
GTK_gtkgl_INCLUDE_PATH )
) ENDIF(GTK_gtkgl_INCLUDE_PATH AND GTK_gtkgl_LIBRARY)
ENDIF(GTK_gtkgl_LIBRARY)
ENDIF(GTK_gtkgl_INCLUDE_PATH)
ENDIF(GTK_glib_LIBRARY) ENDIF(GTK_gtk_INCLUDE_PATH
ENDIF(GTK_gtk_LIBRARY) AND GTK_glibconfig_INCLUDE_PATH
ENDIF(GTK_glib_INCLUDE_PATH) AND GTK_glib_INCLUDE_PATH
ENDIF(GTK_glibconfig_INCLUDE_PATH) AND GTK_gtk_LIBRARY
ENDIF(GTK_gtk_INCLUDE_PATH) AND GTK_glib_LIBRARY)
MARK_AS_ADVANCED( MARK_AS_ADVANCED(
GTK_gdk_LIBRARY GTK_gdk_LIBRARY
@ -184,3 +148,5 @@ IF(UNIX)
ENDIF(UNIX) ENDIF(UNIX)

View File

@ -1,20 +1,28 @@
# - this module looks for gnuplot # - this module looks for gnuplot
# #
# Once done this will define
#
# GNUPLOT_FOUND - system has Gnuplot
# GNUPLOT_EXECUTABLE - the Gnuplot executable
INCLUDE(FindCygwin) INCLUDE(FindCygwin)
FIND_PROGRAM(GNUPLOT FIND_PROGRAM(GNUPLOT_EXECUTABLE
NAMES NAMES
gnuplot gnuplot
pgnuplot pgnuplot
wgnupl32 wgnupl32
PATH PATHS
${CYGWIN_INSTALL_PATH}/bin ${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 )

View File

@ -22,21 +22,11 @@ FIND_PATH(HSPELL_INCLUDE_DIR hspell.h )
FIND_LIBRARY(HSPELL_LIBRARIES NAMES hspell ) FIND_LIBRARY(HSPELL_LIBRARIES NAMES hspell )
IF (HSPELL_INCLUDE_DIR AND HSPELL_LIBRARIES) # handle the QUIETLY and REQUIRED arguments and set HSPELL_FOUND to TRUE if
SET(HSPELL_FOUND TRUE) # all listed variables are TRUE
ELSE (HSPELL_INCLUDE_DIR AND HSPELL_LIBRARIES) INCLUDE(FindPackageHandleStandardArgs)
SET(HSPELL_FOUND FALSE) FIND_PACKAGE_HANDLE_STANDARD_ARGS(HSPELL HSPELL_LIBRARIES HSPELL_INCLUDE_DIR)
ENDIF (HSPELL_INCLUDE_DIR AND HSPELL_LIBRARIES)
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) MARK_AS_ADVANCED(HSPELL_INCLUDE_DIR HSPELL_LIBRARIES)

View File

@ -8,28 +8,22 @@
# MPEG_vo_LIBRARY, where to find the vo library. # MPEG_vo_LIBRARY, where to find the vo library.
FIND_PATH(MPEG_INCLUDE_DIR mpeg2dec/include/video_out.h FIND_PATH(MPEG_INCLUDE_DIR mpeg2dec/include/video_out.h
/usr/local/include
/usr/include
/usr/local/livid /usr/local/livid
) )
FIND_LIBRARY(MPEG_mpeg2_LIBRARY mpeg2 FIND_LIBRARY(MPEG_mpeg2_LIBRARY mpeg2
/usr/local/lib
/usr/lib
/usr/local/livid/mpeg2dec/libmpeg2/.libs /usr/local/livid/mpeg2dec/libmpeg2/.libs
) )
FIND_LIBRARY( MPEG_vo_LIBRARY vo FIND_LIBRARY( MPEG_vo_LIBRARY vo
/usr/local/lib
/usr/lib
/usr/local/livid/mpeg2dec/libvo/.libs /usr/local/livid/mpeg2dec/libvo/.libs
) )
SET( MPEG_FOUND "NO" ) # handle the QUIETLY and REQUIRED arguments and set MPEG2_FOUND to TRUE if
IF(MPEG_INCLUDE_DIR) # all listed variables are TRUE
IF(MPEG_mpeg2_LIBRARY) INCLUDE(FindPackageHandleStandardArgs)
SET( MPEG_FOUND "YES" ) FIND_PACKAGE_HANDLE_STANDARD_ARGS(MPEG MPEG_INCLUDE_DIR MPEG_mpeg2_LIBRARY)
SET( MPEG_LIBRARIES ${MPEG_mpeg2_LIBRARY} ${MPEG_vo_LIBRARY} )
ENDIF(MPEG_mpeg2_LIBRARY)
ENDIF(MPEG_INCLUDE_DIR)
IF(MPEG_FOUND)
SET( MPEG_LIBRARIES ${MPEG_mpeg2_LIBRARY} ${MPEG_vo_LIBRARY} )
ENDIF(MPEG_FOUND)

View File

@ -8,36 +8,32 @@
# MPEG2_vo_LIBRARY, where to find the vo library. # MPEG2_vo_LIBRARY, where to find the vo library.
FIND_PATH(MPEG2_INCLUDE_DIR mpeg2.h FIND_PATH(MPEG2_INCLUDE_DIR mpeg2.h
/usr/local/include
/usr/include
/usr/local/livid /usr/local/livid
) )
FIND_LIBRARY(MPEG2_mpeg2_LIBRARY mpeg2 FIND_LIBRARY(MPEG2_mpeg2_LIBRARY mpeg2
/usr/local/lib
/usr/lib
/usr/local/livid/mpeg2dec/libmpeg2/.libs /usr/local/livid/mpeg2dec/libmpeg2/.libs
) )
FIND_LIBRARY( MPEG2_vo_LIBRARY vo FIND_LIBRARY( MPEG2_vo_LIBRARY vo
/usr/local/lib
/usr/lib
/usr/local/livid/mpeg2dec/libvo/.libs /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 # handle the QUIETLY and REQUIRED arguments and set MPEG2_FOUND to TRUE if
#on libSDL, if found, add it in. # all listed variables are TRUE
INCLUDE( ${MODULE_PATH}/NewCMake/FindSDL.cmake ) INCLUDE(FindPackageHandleStandardArgs)
IF(SDL_FOUND) FIND_PACKAGE_HANDLE_STANDARD_ARGS(MPEG2 MPEG2_mpeg2_LIBRARY MPEG2_INCLUDE_DIR)
SET( MPEG2_LIBRARIES ${MPEG2_LIBRARIES} ${SDL_LIBRARY})
ENDIF(SDL_FOUND) 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)
ENDIF(MPEG2_mpeg2_LIBRARY)
ENDIF(MPEG2_INCLUDE_DIR)

View File

@ -5,28 +5,26 @@
# MOTIF_LIBRARIES - Link these to use Motif # MOTIF_LIBRARIES - Link these to use Motif
SET(MOTIF_FOUND 0) SET(MOTIF_FOUND 0)
IF(UNIX) IF(UNIX)
FIND_PATH(MOTIF_INCLUDE_DIR FIND_PATH(MOTIF_INCLUDE_DIR
Xm/Xm.h Xm/Xm.h
/usr/X11R6/include
/usr/local/include
/usr/openwin/include /usr/openwin/include
/usr/include
) )
FIND_LIBRARY(MOTIF_LIBRARIES FIND_LIBRARY(MOTIF_LIBRARIES
Xm Xm
/usr/X11R6/lib
/usr/local/lib
/usr/openwin/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) 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( MARK_AS_ADVANCED(
MOTIF_INCLUDE_DIR MOTIF_INCLUDE_DIR
MOTIF_LIBRARIES MOTIF_LIBRARIES

View File

@ -14,20 +14,13 @@ FIND_PROGRAM(PERL_EXECUTABLE
${CYGWIN_INSTALL_PATH}/bin ${CYGWIN_INSTALL_PATH}/bin
) )
MARK_AS_ADVANCED(
PERL_EXECUTABLE
)
IF (NOT PERL_EXECUTABLE) # Deprecated settings for compatibility with CMake1.4
SET(PERL_FOUND "NO") SET (PERL ${PERL_EXECUTABLE})
ELSE (NOT PERL_EXECUTABLE)
SET(PERL_FOUND "YES")
# Deprecated settings for compatibility with CMake1.4 # handle the QUIETLY and REQUIRED arguments and set PERL_FOUND to TRUE if
SET (PERL ${PERL_EXECUTABLE}) # all listed variables are TRUE
ENDIF (NOT PERL_EXECUTABLE) INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Perl PERL_EXECUTABLE)
MARK_AS_ADVANCED( 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)

View File

@ -14,23 +14,15 @@
# On OSX, this will prefer the Framework version (if found) over others. # On OSX, this will prefer the Framework version (if found) over others.
# People will have to manually change the cache values of # People will have to manually change the cache values of
# PHYSFS_LIBRARY to override this selection. # 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 $ENV{PHYSFSDIR}/include
~/Library/Frameworks/PhysFS.framework/Headers ~/Library/Frameworks/PhysFS.framework/Headers
/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 # 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. # unlikely that other Unix systems will find the framework path.
# But if they do ([Next|Open|GNU]Step?), # But if they do ([Next|Open|GNU]Step?),
@ -58,17 +50,11 @@ ELSE(${PHYSFS_INCLUDE_DIR} MATCHES ".framework")
NAMES physfs PhysFS NAMES physfs PhysFS
PATHS PATHS
$ENV{PHYSFSDIR}/lib $ENV{PHYSFSDIR}/lib
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
) )
ENDIF(${PHYSFS_INCLUDE_DIR} MATCHES ".framework") ENDIF(${PHYSFS_INCLUDE_DIR} MATCHES ".framework")
SET(PHYSFS_FOUND "NO") # handle the QUIETLY and REQUIRED arguments and set PHYSFS_FOUND to TRUE if
IF(PHYSFS_LIBRARY) # all listed variables are TRUE
SET(PHYSFS_FOUND "YES") INCLUDE(FindPackageHandleStandardArgs)
ENDIF(PHYSFS_LIBRARY) FIND_PACKAGE_HANDLE_STANDARD_ARGS(PhysFS PHYSFS_LIBRARY PHYSFS_INCLUDE_DIR)

View File

@ -16,9 +16,6 @@ FIND_PATH(PIKE_INCLUDE_PATH program.h
FIND_PROGRAM(PIKE_EXECUTABLE FIND_PROGRAM(PIKE_EXECUTABLE
NAMES pike7.4 NAMES pike7.4
PATHS
/usr/bin
/usr/local/bin
) )
MARK_AS_ADVANCED( MARK_AS_ADVANCED(

View File

@ -10,110 +10,53 @@
# #
INCLUDE(CMakeFindFrameworks) INCLUDE(CMakeFindFrameworks)
IF(WIN32)
FIND_LIBRARY(PYTHON_DEBUG_LIBRARY
NAMES python25_d python24_d python23_d python22_d python21_d python20_d python
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
)
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. # Search for the python framework on Apple.
CMAKE_FIND_FRAMEWORKS(Python) 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 FOREACH(_CURRENT_VERSION 2.5 2.4 2.3 2.2 2.1 2.0 1.6 1.5)
NAMES Python.h 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)
PATHS FIND_LIBRARY(PYTHON_LIBRARY
${PYTHON_FRAMEWORK_INCLUDES} NAMES python${_CURRENT_VERSION_NO_DOTS} python${_CURRENT_VERSION}
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath]/include PATHS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]/include [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]/include PATH_SUFFIXES
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.2\\InstallPath]/include python${_CURRENT_VERSION}/config
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.1\\InstallPath]/include # Avoid finding the .dll in the PATH. We want the .lib.
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.0\\InstallPath]/include NO_SYSTEM_ENVIRONMENT_PATH
[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
)
IF (WIN32)
MARK_AS_ADVANCED(
PYTHON_DEBUG_LIBRARY
PYTHON_LIBRARY
PYTHON_INCLUDE_PATH
) )
ENDIF(WIN32)
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)
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}
)
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 # Python Should be built and installed as a Framework on OSX
IF(Python_FRAMEWORKS) IF(Python_FRAMEWORKS)
@ -141,3 +84,44 @@ SET(PYTHON_DEBUG_LIBRARIES "${PYTHON_DEBUG_LIBRARY}")
INCLUDE(FindPackageHandleStandardArgs) INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibs PYTHON_LIBRARIES PYTHON_INCLUDE_PATH) 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)

View File

@ -29,27 +29,15 @@
# This needed to change because "proper" SDL convention # This needed to change because "proper" SDL convention
# is #include "SDL.h", not <SDL/SDL.h>. This is done for portability # is #include "SDL.h", not <SDL/SDL.h>. This is done for portability
# reasons because not all systems place things in SDL/ (see FreeBSD). # 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 $ENV{SDLDIR}/include
~/Library/Frameworks/SDL.framework/Headers ~/Library/Frameworks/SDL.framework/Headers
/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 # 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. # unlikely that other Unix systems will find the framework path.
# But if they do ([Next|Open|GNU]Step?), # But if they do ([Next|Open|GNU]Step?),
@ -86,13 +74,8 @@ ELSE(${SDL_INCLUDE_DIR} MATCHES ".framework")
NAMES SDL SDL-1.1 NAMES SDL SDL-1.1
PATHS PATHS
$ENV{SDLDIR}/lib $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 # Non-OS X framework versions expect you to also dynamically link to
# SDLmain. This is mainly for Windows and OS X. Other platforms # SDLmain. This is mainly for Windows and OS X. Other platforms
# seem to provide SDLmain for compatibility even though they don't # 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 NAMES SDLmain SDLmain-1.1
PATHS PATHS
$ENV{SDLDIR}/lib $ENV{SDLDIR}/lib
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
) )
ENDIF(${SDL_INCLUDE_DIR} MATCHES ".framework") ENDIF(${SDL_INCLUDE_DIR} MATCHES ".framework")
@ -125,7 +102,6 @@ IF(MINGW)
SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW") SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW")
ENDIF(MINGW) ENDIF(MINGW)
SET(SDL_FOUND "NO")
IF(SDL_LIBRARY_TEMP) IF(SDL_LIBRARY_TEMP)
# For SDLmain # For SDLmain
IF(SDLMAIN_LIBRARY) IF(SDLMAIN_LIBRARY)
@ -156,7 +132,11 @@ IF(SDL_LIBRARY_TEMP)
# Set the final string here so the GUI reflects the final state. # 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_LIBRARY ${SDL_LIBRARY_TEMP} CACHE STRING "Where the SDL Library can be found")
SET(SDL_FOUND "YES")
ENDIF(SDL_LIBRARY_TEMP) 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) MARK_AS_ADVANCED(SDL_LIBRARY_TEMP)

View File

@ -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.3;Root]/lib
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/lib [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.2;Root]/lib
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/lib [HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.0;Root]/lib
/usr/lib
/usr/local/lib
) )
FIND_LIBRARY(TCL_LIBRARY FIND_LIBRARY(TCL_LIBRARY

View File

@ -2,14 +2,14 @@
# This module finds if TCL is installed and determines where the # This module finds if TCL is installed and determines where the
# include files and libraries are. It also determines what the name of # include files and libraries are. It also determines what the name of
# the library is. This code sets the following variables: # 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 # TCL_TCLSH = the path to the tclsh executable
# In cygwin, look for the cygwin version first. Don't look for it later to # In cygwin, look for the cygwin version first. Don't look for it later to
# avoid finding the cygwin version on a Win32 build. # avoid finding the cygwin version on a Win32 build.
IF(WIN32)
IF(UNIX) IF(WIN32 AND UNIX)
FIND_PROGRAM(TCL_TCLSH NAMES cygtclsh83 cygtclsh80) FIND_PROGRAM(TCL_TCLSH NAMES cygtclsh83 cygtclsh80)
ENDIF(UNIX) ENDIF(WIN32 AND UNIX)
ENDIF(WIN32)
GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH) GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH)
GET_FILENAME_COMPONENT(TK_LIBRARY_PATH "${TK_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 [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 ) MARK_AS_ADVANCED( TCL_TCLSH )

View File

@ -11,16 +11,12 @@ FIND_PROGRAM(WGET_EXECUTABLE
${CYGWIN_INSTALL_PATH}/bin ${CYGWIN_INSTALL_PATH}/bin
) )
IF (WGET_EXECUTABLE) # handle the QUIETLY and REQUIRED arguments and set WGET_FOUND to TRUE if
SET(WGET_FOUND "Yes") # all listed variables are TRUE
ELSE (WGET_EXECUTABLE) INCLUDE(FindPackageHandleStandardArgs)
SET(WGET_FOUND "No") FIND_PACKAGE_HANDLE_STANDARD_ARGS(Wget WGET_EXECUTABLE)
ENDIF (WGET_EXECUTABLE)
MARK_AS_ADVANCED( WGET_EXECUTABLE )
MARK_AS_ADVANCED(
WGET_EXECUTABLE
)
# WGET option is deprecated. # WGET option is deprecated.
# use WGET_EXECUTABLE instead. # use WGET_EXECUTABLE instead.

View File

@ -53,7 +53,7 @@ For example:
# #
# It even needs to paragraphs to tell you about it. # It even needs to paragraphs to tell you about it.
# And it defines the following variables: # 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? # 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 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 XXX_FIND_QUIETLY to true before loading the FindXXX.cmake module. If
this variable is set the module should not complain about not being 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 REQUIRED option is given to the command it will set the variable
XXX_FIND_REQUIRED to true before loading the FindXXX.cmake module. If 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 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 If neither the QUIET nor REQUIRED options are given then the
FindXXX.cmake module should look for the package and complain without FindXXX.cmake module should look for the package and complain without
error if the module is not found. 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.