1 # - Try to find Glib-2.0 (with gobject)
2 # Once done, this will define
4 # Glib_FOUND - system has Glib
5 # Glib_INCLUDE_DIRS - the Glib include directories
6 # Glib_LIBRARIES - link these to use Glib
10 # Use pkg-config to get hints about paths
11 libfind_pkg_check_modules(Glib_PKGCONF glib-2.0)
14 find_path(Glib_INCLUDE_DIR
16 PATHS ${Glib_PKGCONF_INCLUDE_DIRS}
17 PATH_SUFFIXES glib-2.0
20 # Glib-related libraries also use a separate config header, which is in lib dir
21 find_path(GlibConfig_INCLUDE_DIR
23 PATHS ${Glib_PKGCONF_INCLUDE_DIRS} /usr
24 PATH_SUFFIXES lib/glib-2.0/include
27 # Finally the library itself
28 find_library(Glib_LIBRARY
30 PATHS ${Glib_PKGCONF_LIBRARY_DIRS}
33 # Set the include dir variables and the libraries and let libfind_process do the rest.
34 # NOTE: Singular variables for this library, plural for libraries this this lib depends on.
35 set(Glib_PROCESS_INCLUDES Glib_INCLUDE_DIR GlibConfig_INCLUDE_DIR)
36 set(Glib_PROCESS_LIBS Glib_LIBRARY)