summaryrefslogtreecommitdiff
path: root/cmake/FindGmodule.cmake
blob: 2d5ddd0bb98c50aa15899002616f028acae18ef8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# - Try to find Glib-2.0 (with gobject)
# Once done, this will define
#
#  Glib_FOUND - system has Glib
#  Glib_INCLUDE_DIRS - the Glib include directories
#  Glib_LIBRARIES - link these to use Glib

include(LibFindMacros)

libfind_pkg_check_modules(Gmodule_PKGCONF gmodule-2.0)
# Main include dir
find_path(Gmodule_INCLUDE_DIR
  NAMES gmodule.h
  PATHS ${Gmodule_PKGCONF_INCLUDE_DIRS}
  PATH_SUFFIXES gmodule-2.0
)

# Finally the modulerary itself
find_library(Gmodule_LIBRARY
  NAMES gmodule-2.0
  PATHS ${Gmodule_PKGCONF_LIBRARY_DIRS}
)

# Set the include dir variables and the libraries and let libfind_process do the rest.
# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
set(Gmodule_PROCESS_INCLUDES Gmodule_INCLUDE_DIR)
set(Gmodule_PROCESS_LIBS Gmodule_LIBRARY)
libfind_process(Gmodule)