aboutsummaryrefslogtreecommitdiff
path: root/cmake/FindGModule.cmake
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2017-03-23 17:10:45 +0100
committerMarvin W <git@larma.de>2017-03-23 17:16:08 +0100
commite6f89f8751e6e65d4a36a125cc3fe398098ba504 (patch)
tree54acce89355ee07b05db761d6d0dad8dad4e0f36 /cmake/FindGModule.cmake
parentef0483765a0fd567f25b1f0af6df04e8973e5624 (diff)
downloaddino-e6f89f8751e6e65d4a36a125cc3fe398098ba504.tar.gz
dino-e6f89f8751e6e65d4a36a125cc3fe398098ba504.zip
New CMake
- add install and uninstall targets - compatibility for systems without pkg-config
Diffstat (limited to 'cmake/FindGModule.cmake')
-rw-r--r--cmake/FindGModule.cmake20
1 files changed, 20 insertions, 0 deletions
diff --git a/cmake/FindGModule.cmake b/cmake/FindGModule.cmake
new file mode 100644
index 00000000..61233145
--- /dev/null
+++ b/cmake/FindGModule.cmake
@@ -0,0 +1,20 @@
+include(PkgConfigWithFallback)
+find_pkg_config_with_fallback(GModule
+ PKG_CONFIG_NAME gmodule-2.0
+ LIB_NAMES gmodule-2.0
+ INCLUDE_NAMES gmodule.h
+ INCLUDE_DIR_SUFFIXES glib-2.0 glib-2.0/include
+ DEPENDS GLib
+)
+
+if(GModule_FOUND AND NOT GModule_VERSION)
+ find_package(GLib)
+ set(GModule_VERSION ${GLib_VERSION})
+endif()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(GModule
+ FOUND_VAR GModule_FOUND
+ REQUIRED_VARS GModule_LIBRARY
+ VERSION_VAR GModule_VERSION
+) \ No newline at end of file