ENH: rename variables from GIFLIB_* to GIF_*

-add standard QUIET and REQUIRED handling
-add GIF_LIBRARIES variable as readme.txt says
-add name giflib to the names for the gif library
-remove some unnecessary search paths for the lib (they are already part of
the standard search paths, see Modules/Platform/UnixPaths.cmake)
-FindFreetype.cmake: use PATH_SUFFIXES include again for the headers with
the CMAKE_PREFIX_PATH variable

Alex
This commit is contained in:
Alexander Neundorf 2008-01-04 12:38:34 -05:00
parent daa45056c9
commit eed9b1b0da
2 changed files with 39 additions and 38 deletions

View File

@ -10,7 +10,11 @@
# $FREETYPE_DIR is an environment variable that would
# correspond to the ./configure --prefix=$FREETYPE_DIR
# used in building FREETYPE.
# Created by Eric Wing.
# Modifications by Alexander Neundorf.
# This file has been renamed to "FindFreetype.cmake" instead of the correct
# "FindFreeType.cmake" in order to be compatible with the one from KDE4, Alex.
# Ugh, FreeType seems to use some #include trickery which
# makes this harder than it should be. It looks like they
@ -30,8 +34,9 @@ FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
PATH_SUFFIXES include
)
FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
PATHS ${CMAKE_PREFIX_PATH}/include # Unofficial: We are proposing this.
PATHS ${CMAKE_PREFIX_PATH} # Unofficial: We are proposing this.
NO_DEFAULT_PATH
PATH_SUFFIXES include
)
FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
@ -49,9 +54,9 @@ FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
NO_DEFAULT_PATH
)
FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
PATHS ${CMAKE_PREFIX_PATH}/include # Unofficial: We are proposing this.
PATHS ${CMAKE_PREFIX_PATH} # Unofficial: We are proposing this.
NO_DEFAULT_PATH
PATH_SUFFIXES freetype2
PATH_SUFFIXES include/freetype2
)
FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
/usr/local/X11R6/include
@ -79,16 +84,10 @@ FIND_LIBRARY(FREETYPE_LIBRARY
FIND_LIBRARY(FREETYPE_LIBRARY
NAMES freetype libfreetype freetype219
PATHS
/usr/local
/usr
/usr/local/X11R6
/usr/local/X11
/usr/X11R6
/usr/X11
/sw
/opt/local
/opt/csw
/opt
/usr/freeware
PATH_SUFFIXES lib64 lib
)
@ -99,7 +98,7 @@ IF(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
ENDIF(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
SET(FREETYPE_LIBRARIES "${FREETYPE_LIBRARY}")
# handle the QUIETLY and REQUIRED arguments and set PERLLIBS_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set FREETYPE_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Freetype DEFAULT_MSG FREETYPE_LIBRARY FREETYPE_INCLUDE_DIRS)

View File

@ -1,57 +1,56 @@
# This module defines
# GIFLIB_LIBRARY
# GIFLIB_FOUND, if false, do not try to link
# GIFLIB_INCLUDE_DIR, where to find the headers
# GIF_LIBRARIES - libraries to link to in order to use GIF
# GIF_FOUND, if false, do not try to link
# GIF_INCLUDE_DIR, where to find the headers
#
# $GIFLIB_DIR is an environment variable that would
# correspond to the ./configure --prefix=$GIFLIB_DIR
#
# Created by Eric Wing.
# $GIF_DIR is an environment variable that would
# correspond to the ./configure --prefix=$GIF_DIR
FIND_PATH(GIFLIB_INCLUDE_DIR gif_lib.h
# Created by Eric Wing.
# Modifications by Alexander Neundorf
FIND_PATH(GIF_INCLUDE_DIR gif_lib.h
PATHS
$ENV{GIFLIB_DIR}
$ENV{GIF_DIR}
NO_DEFAULT_PATH
PATH_SUFFIXES include
)
FIND_PATH(GIFLIB_INCLUDE_DIR gif_lib.h
FIND_PATH(GIF_INCLUDE_DIR gif_lib.h
PATHS ${CMAKE_PREFIX_PATH} # Unofficial: We are proposing this.
NO_DEFAULT_PATH
PATH_SUFFIXES include
)
FIND_PATH(GIFLIB_INCLUDE_DIR gif_lib.h
FIND_PATH(GIF_INCLUDE_DIR gif_lib.h
PATHS
~/Library/Frameworks
/Library/Frameworks
/usr/local/include
/usr/include
/sw/include # Fink
/opt/local/include # DarwinPorts
/opt/csw/include # Blastwave
/opt/include
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
/usr/freeware/include
)
FIND_LIBRARY(GIFLIB_LIBRARY
NAMES gif ungif libgif libungif
# the gif library can have many names :-/
SET(POTENTIAL_GIF_LIBS gif libgif ungif libungif giflib)
FIND_LIBRARY(GIF_LIBRARY
NAMES ${POTENTIAL_GIF_LIBS}
PATHS
$ENV{GIFLIB_DIR}
$ENV{GIF_DIR}
NO_DEFAULT_PATH
PATH_SUFFIXES lib64 lib
)
FIND_LIBRARY(GIFLIB_LIBRARY
NAMES gif ungif libgif libungif
FIND_LIBRARY(GIF_LIBRARY
NAMES ${POTENTIAL_GIF_LIBS}
PATHS ${CMAKE_PREFIX_PATH} # Unofficial: We are proposing this.
NO_DEFAULT_PATH
PATH_SUFFIXES lib64 lib
)
FIND_LIBRARY(GIFLIB_LIBRARY
NAMES gif ungif libgif libungif
FIND_LIBRARY(GIF_LIBRARY
NAMES ${POTENTIAL_GIF_LIBS}
PATHS
~/Library/Frameworks
/Library/Frameworks
@ -66,9 +65,12 @@ FIND_LIBRARY(GIFLIB_LIBRARY
PATH_SUFFIXES lib64 lib
)
SET(GIFLIB_FOUND "NO")
IF(GIFLIB_LIBRARY AND GIFLIB_INCLUDE_DIR)
SET(GIFLIB_FOUND "YES")
ENDIF(GIFLIB_LIBRARY AND GIFLIB_INCLUDE_DIR)
# see readme.txt
SET(GIF_LIBRARIES ${GIF_LIBRARY})
# handle the QUIETLY and REQUIRED arguments and set GIF_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GIF DEFAULT_MSG GIF_LIBRARY GIF_INCLUDE_DIR)
MARK_AS_ADVANCED(GIF_INCLUDE_DIR GIF_LIBRARY)