[cmake-commits] alex committed FindGIF.cmake 1.1 1.2 FindFreetype.cmake 1.2 1.3

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Jan 4 12:38:36 EST 2008


Update of /cvsroot/CMake/CMake/Modules
In directory public:/mounts/ram/cvs-serv29152

Modified Files:
	FindGIF.cmake FindFreetype.cmake 
Log Message:
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



Index: FindFreetype.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/FindFreetype.cmake,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- FindFreetype.cmake	4 Jan 2008 12:29:40 -0000	1.2
+++ FindFreetype.cmake	4 Jan 2008 17:38:34 -0000	1.3
@@ -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
@@ -27,11 +31,12 @@
 FIND_PATH(FREETYPE_INCLUDE_DIR_ft2build ft2build.h 
   $ENV{FREETYPE_DIR}
   NO_DEFAULT_PATH
-  PATH_SUFFIXES include    
+  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 @@
   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
   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 @@
 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)

Index: FindGIF.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/FindGIF.cmake,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- FindGIF.cmake	4 Jan 2008 17:29:29 -0000	1.1
+++ FindGIF.cmake	4 Jan 2008 17:38:34 -0000	1.2
@@ -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 @@
   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)



More information about the Cmake-commits mailing list