Merge topic 'FindGTK2_fixes'

f6ca76f Several fixes needed to improve Windows support
74a12f3 Add detection for new pangommconfig.h header file
This commit is contained in:
Brad King 2010-08-17 15:10:48 -04:00 committed by CMake Topic Stage
commit 57c5bf5b18

View File

@ -28,6 +28,8 @@
#
# GTK2_DEBUG - Enables verbose debugging of the module
# GTK2_SKIP_MARK_AS_ADVANCED - Disable marking cache variables as advanced
# GTK2_ADDITIONAL_SUFFIXES - Allows defining additional directories to
# search for include files
#
#=================
# Example Usage:
@ -64,6 +66,15 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Version 1.0 (8/12/2010)
# * Add support for detecting new pangommconfig.h header file
# (Thanks to Sune Vuorela & the Debian Project for the patch)
# * Add support for detecting fontconfig.h header
# * Call find_package(Freetype) since it's required
# * Add support for allowing users to add additional library directories
# via the GTK2_ADDITIONAL_SUFFIXES variable (kind of a future-kludge in
# case the GTK developers change versions on any of the directories in the
# future).
# Version 0.8 (1/4/2010)
# * Get module working under MacOSX fink by adding /sw/include, /sw/lib
# to PATHS and the gobject library
@ -131,7 +142,8 @@ function(_GTK2_FIND_INCLUDE_DIR _var _hdr)
endif()
set(_relatives
# FIXME
# If these ever change, things will break.
${GTK2_ADDITIONAL_SUFFIXES}
glibmm-2.4
glib-2.0
atk-1.0
@ -390,6 +402,10 @@ endif()
# Find all components
#
find_package(Freetype)
list(APPEND GTK2_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIRS})
list(APPEND GTK2_LIBRARIES ${FREETYPE_LIBRARIES})
foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
if(_GTK2_component STREQUAL "gtk")
_GTK2_FIND_INCLUDE_DIR(GTK2_GLIB_INCLUDE_DIR glib.h)
@ -401,16 +417,21 @@ foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
_GTK2_FIND_INCLUDE_DIR(GTK2_GDK_INCLUDE_DIR gdk/gdk.h)
_GTK2_FIND_INCLUDE_DIR(GTK2_GDKCONFIG_INCLUDE_DIR gdkconfig.h)
_GTK2_FIND_LIBRARY (GTK2_GDK_LIBRARY gdk-x11 false true)
_GTK2_FIND_LIBRARY (GTK2_GDK_LIBRARY gdk-win32 false true)
_GTK2_FIND_INCLUDE_DIR(GTK2_GTK_INCLUDE_DIR gtk/gtk.h)
_GTK2_FIND_LIBRARY (GTK2_GTK_LIBRARY gtk-x11 false true)
_GTK2_FIND_LIBRARY (GTK2_GTK_LIBRARY gtk-win32 false true)
if(UNIX)
_GTK2_FIND_LIBRARY (GTK2_GDK_LIBRARY gdk-x11 false true)
_GTK2_FIND_LIBRARY (GTK2_GTK_LIBRARY gtk-x11 false true)
else()
_GTK2_FIND_LIBRARY (GTK2_GDK_LIBRARY gdk-win32 false true)
_GTK2_FIND_LIBRARY (GTK2_GTK_LIBRARY gtk-win32 false true)
endif()
_GTK2_FIND_INCLUDE_DIR(GTK2_CAIRO_INCLUDE_DIR cairo.h)
_GTK2_FIND_LIBRARY (GTK2_CAIRO_LIBRARY cairo false false)
_GTK2_FIND_INCLUDE_DIR(GTK2_FONTCONFIG_INCLUDE_DIR fontconfig/fontconfig.h)
_GTK2_FIND_INCLUDE_DIR(GTK2_PANGO_INCLUDE_DIR pango/pango.h)
_GTK2_FIND_LIBRARY (GTK2_PANGO_LIBRARY pango false true)
@ -439,6 +460,7 @@ foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
_GTK2_FIND_LIBRARY (GTK2_CAIROMM_LIBRARY cairomm true true)
_GTK2_FIND_INCLUDE_DIR(GTK2_PANGOMM_INCLUDE_DIR pangomm.h)
_GTK2_FIND_INCLUDE_DIR(GTK2_PANGOMMCONFIG_INCLUDE_DIR pangommconfig.h)
_GTK2_FIND_LIBRARY (GTK2_PANGOMM_LIBRARY pangomm true true)
_GTK2_FIND_INCLUDE_DIR(GTK2_SIGC++_INCLUDE_DIR sigc++/sigc++.h)