| 1 |
# - Try to find GConf |
| 2 |
# Once done, this will define |
| 3 |
# |
| 4 |
# GCONF_FOUND - system has GCONF |
| 5 |
# GCONF_INCLUDE_DIRS - the GCONF include directories |
| 6 |
# GCONF_LIBRARIES - link these to use GCONF |
| 7 |
|
| 8 |
include(LibFindMacros) |
| 9 |
|
| 10 |
# Dependencies |
| 11 |
# The current package name (GCONF) is included as first paramater in order to foward the REQUIRED or QUIET paramaters |
| 12 |
# to the find_package for the dependent library (ie Threads) |
| 13 |
libfind_package(GCONF GLib) |
| 14 |
libfind_package(GCONF GObject) |
| 15 |
|
| 16 |
# Use pkg-config to get hints about paths |
| 17 |
libfind_pkg_check_modules(GCONF_PKGCONF gconf-2.0) |
| 18 |
|
| 19 |
# Include dir |
| 20 |
find_path(GCONF_INCLUDE_DIR |
| 21 |
NAMES gconf/gconf.h |
| 22 |
HINTS ${GCONF_PKGCONF_INCLUDE_DIRS} |
| 23 |
) |
| 24 |
|
| 25 |
# Finally the library itself |
| 26 |
find_library(GCONF_LIBRARY |
| 27 |
NAMES gconf-2 |
| 28 |
HINTS ${GCONF_PKGCONF_LIBRARY_DIRS} |
| 29 |
) |
| 30 |
|
| 31 |
# Set the include dir variables and the libraries and let libfind_process do the rest. |
| 32 |
# NOTE: Singular variables for this library, plural for libraries this this lib depends on. |
| 33 |
set(GCONF_PROCESS_INCLUDES GCONF_INCLUDE_DIR GLib_INCLUDE_DIRS GObject_INCLUDE_DIRS) |
| 34 |
set(GCONF_PROCESS_LIBS GCONF_LIBRARY GLib_LIBRARIES GObject_LIBRARIES) |
| 35 |
libfind_process(GCONF) |
| 36 |
|
| 37 |
mark_as_advanced(GLib_DIR GObject_DIR) |