20
20
# use pkg-config to get the directories and then use these values
21
21
# in the FIND_PATH() and FIND_LIBRARY() calls
22
find_package(PkgConfig)
23
pkg_check_modules(GOBJECT gobject-2.0)
22
FIND_PACKAGE(PkgConfig)
23
PKG_CHECK_MODULES(PC_GOBJECT gobject-2.0)
24
24
#MESSAGE(STATUS "DEBUG: GObject include directory = ${GOBJECT_INCLUDE_DIRS}")
25
25
#MESSAGE(STATUS "DEBUG: GObject link directory = ${GOBJECT_LIBRARY_DIRS}")
26
26
#MESSAGE(STATUS "DEBUG: GObject CFlags = ${GOBJECT_CFLAGS}")
27
SET(GOBJECT_DEFINITIONS ${GOBJECT_CFLAGS})
27
SET(GOBJECT_DEFINITIONS ${PC_GOBJECT_CFLAGS_OTHER})
30
30
FIND_PATH(GOBJECT_INCLUDE_DIR gobject.h
32
${GOBJECT_INCLUDE_DIRS}
33
${GOBJECT_INCLUDE_DIRS}/glib-2.0/gobject/
34
/usr/include/glib-2.0/gobject/
32
${PC_GOBJECT_INCLUDEDIR}
33
${PC_GOBJECT_INCLUDE_DIRS}
34
PATH_SUFFIXES glib-2.0/gobject/
38
37
FIND_LIBRARY(_GObjectLibs NAMES gobject-2.0
40
${GOBJECT_LIBRARY_DIRS}
40
${PC_GOBJECT_LIBRARY_DIRS}
42
42
FIND_LIBRARY(_GModuleLibs NAMES gmodule-2.0
44
${GOBJECT_LIBRARY_DIRS}
45
${PC_GOBJECT_LIBRARY_DIRS}
46
47
FIND_LIBRARY(_GThreadLibs NAMES gthread-2.0
48
${GOBJECT_LIBRARY_DIRS}
50
${PC_GOBJECT_LIBRARY_DIRS}
50
52
FIND_LIBRARY(_GLibs NAMES glib-2.0
52
${GOBJECT_LIBRARY_DIRS}
55
${PC_GOBJECT_LIBRARY_DIRS}
55
58
SET( GOBJECT_LIBRARIES ${_GObjectLibs} ${_GModuleLibs} ${_GThreadLibs} ${_GLibs} )