1# - Try to find GDK 2.0 2# Once done, this will define 3# 4# GDK_FOUND - system has GDK 5# GDK_INCLUDE_DIRS - the GDK include directories 6# GDK_LIBRARIES - link these to use GDK 7 8include(LibFindMacros) 9 10# Dependencies 11libfind_package(GDK GDK-PixBuf) 12libfind_package(GDK Pango) 13libfind_package(GDK GIO) 14 15# Use pkg-config to get hints about paths 16libfind_pkg_check_modules(GDK_PKGCONF gdk-2.0) 17 18# Main include dir 19find_path(GDK_INCLUDE_DIR 20 NAMES gdk/gdk.h 21 PATHS ${GDK_PKGCONF_INCLUDE_DIRS} 22 PATH_SUFFIXES gtk-2.0 23) 24 25# Glib-related libraries also use a separate config header, which is in lib dir 26find_path(GDKConfig_INCLUDE_DIR 27 NAMES gdkconfig.h 28 PATHS ${GDK_PKGCONF_INCLUDE_DIRS} /usr 29 PATH_SUFFIXES lib/gtk-2.0/include 30) 31 32# Finally the library itself 33find_library(GDK_LIBRARY 34 NAMES gdk-x11-2.0 gdk-win32-2.0 35 PATHS ${GDK_PKGCONF_LIBRARY_DIRS} 36) 37 38# Set the include dir variables and the libraries and let libfind_process do the rest. 39# NOTE: Singular variables for this library, plural for libraries this this lib depends on. 40set(GDK_PROCESS_INCLUDES GDK_INCLUDE_DIR GDKConfig_INCLUDE_DIR GDK-PixBuf_INCLUDE_DIRS Pango_INCLUDE_DIRS GIO_INCLUDE_DIRS) 41set(GDK_PROCESS_LIBS GDK_LIBRARY GDK-PixBuf_LIBRARIES Pango_LIBRARIES GIO_LIBRARIES) 42libfind_process(GDK) 43 44