summaryrefslogtreecommitdiffstats
path: root/Modules/FindGIF.cmake
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2008-01-04 17:38:34 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2008-01-04 17:38:34 (GMT)
commiteed9b1b0dac484eea807ac3bb07051b69b94af6b (patch)
tree890e954b2367651526f8fac7a37e54667c140a5d /Modules/FindGIF.cmake
parentdaa45056c9bf4593662a0beb0b601cf78ba29d1b (diff)
downloadCMake-eed9b1b0dac484eea807ac3bb07051b69b94af6b.zip
CMake-eed9b1b0dac484eea807ac3bb07051b69b94af6b.tar.gz
CMake-eed9b1b0dac484eea807ac3bb07051b69b94af6b.tar.bz2
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
Diffstat (limited to 'Modules/FindGIF.cmake')
-rw-r--r--Modules/FindGIF.cmake54
1 files changed, 28 insertions, 26 deletions
diff --git a/Modules/FindGIF.cmake b/Modules/FindGIF.cmake
index b2b2f23..320cdb6 100644
--- a/Modules/FindGIF.cmake
+++ b/Modules/FindGIF.cmake
@@ -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
-#
-# $GIFLIB_DIR is an environment variable that would
-# correspond to the ./configure --prefix=$GIFLIB_DIR
+# 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
#
+# $GIF_DIR is an environment variable that would
+# correspond to the ./configure --prefix=$GIF_DIR
+
# Created by Eric Wing.
+# Modifications by Alexander Neundorf
-FIND_PATH(GIFLIB_INCLUDE_DIR gif_lib.h
+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)