summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2011-01-08 17:58:11 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2011-01-08 17:58:11 +0000
commitafc03d28cf3e6fa5368a82eaad86ed6ff71f1192 (patch)
treeb0cb2014131a6477ea88016a1546a21788ebec0e /cmake
parentb44b2cfad3316102076d0c4a6d17b21702c72ac8 (diff)
downloadnavit-svn-afc03d28cf3e6fa5368a82eaad86ed6ff71f1192.tar.gz
Fix:Build:Check for gmodule
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@3889 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindGmodule.cmake28
1 files changed, 28 insertions, 0 deletions
diff --git a/cmake/FindGmodule.cmake b/cmake/FindGmodule.cmake
new file mode 100644
index 00000000..2d5ddd0b
--- /dev/null
+++ b/cmake/FindGmodule.cmake
@@ -0,0 +1,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)