summaryrefslogtreecommitdiffstats
path: root/Modules/FindGTK2.cmake
diff options
context:
space:
mode:
authorPhilip Lowman <philip@yhbt.com>2010-08-12 05:45:19 (GMT)
committerPhilip Lowman <philip@yhbt.com>2010-08-12 05:45:19 (GMT)
commitf6ca76f195c9a366e1e970a05f747d02285c6a9b (patch)
treeaa37704939f0cda5f911c7d0c952f3abb8ae1b62 /Modules/FindGTK2.cmake
parent74a12f304286ac0479ddecebe12612f9ba400173 (diff)
downloadCMake-f6ca76f195c9a366e1e970a05f747d02285c6a9b.zip
CMake-f6ca76f195c9a366e1e970a05f747d02285c6a9b.tar.gz
CMake-f6ca76f195c9a366e1e970a05f747d02285c6a9b.tar.bz2
Several fixes needed to improve Windows support
* 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). * Fixed a problem on Windows where you had to configure twice to find the gtk & gdk libraries
Diffstat (limited to 'Modules/FindGTK2.cmake')
-rw-r--r--Modules/FindGTK2.cmake33
1 files changed, 27 insertions, 6 deletions
diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake
index 0d012ef..3b99ae2 100644
--- a/Modules/FindGTK2.cmake
+++ b/Modules/FindGTK2.cmake
@@ -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)