summaryrefslogtreecommitdiff
path: root/cmake/modules/FindDBusGLib.cmake
diff options
context:
space:
mode:
authorRalf Habacker <ralf.habacker@freenet.de>2013-08-24 15:00:14 +0200
committerRalf Habacker <ralf.habacker@freenet.de>2013-10-26 10:07:04 +0200
commit8244477d225c35343804b07a23eb60c9c2a4e998 (patch)
tree40d5319ffbc436dac55aba2ed8c06d434f2bcfaa /cmake/modules/FindDBusGLib.cmake
parent41412e04b1a99707456cd205333fd0aa79f172ac (diff)
downloaddbus-68852-make-it-easier.tar.gz
Add glib support to cmake buildsystem.68852-make-it-easier
Diffstat (limited to 'cmake/modules/FindDBusGLib.cmake')
-rw-r--r--cmake/modules/FindDBusGLib.cmake38
1 files changed, 38 insertions, 0 deletions
diff --git a/cmake/modules/FindDBusGLib.cmake b/cmake/modules/FindDBusGLib.cmake
new file mode 100644
index 00000000..19d05e8d
--- /dev/null
+++ b/cmake/modules/FindDBusGLib.cmake
@@ -0,0 +1,38 @@
+# - Try to find the DBUSGLIB libraries
+# Once done this will define
+#
+# DBUSGLIB_FOUND - system has DBUSGLIB
+# DBUSGLIB_INCLUDE_DIR - the DBUSGLIB include directory
+# DBUSGLIB_LIBRARIES - DBUSGLIB library
+
+# Copyright (c) 2013 Ralf Habacker <ralf.habacker@freenet.de>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+if(DBUSGLIB_INCLUDE_DIR AND DBUSGLIB_LIBRARIES)
+ # Already in cache, be silent
+ set(DBUSGLIB_FIND_QUIETLY TRUE)
+endif(DBUSGLIB_INCLUDE_DIR AND DBUSGLIB_LIBRARIES)
+
+if(NOT WIN32)
+ find_package(PkgConfig)
+ pkg_check_modules(PC_LibDBUSGLIB QUIET dbus-glib)
+endif()
+
+find_path(DBUSGLIB_INCLUDE_DIR
+ NAMES dbus/dbus-glib.h
+ HINTS ${PC_LibDBUSGLIB_INCLUDEDIR}
+ PATH_SUFFIXES dbus-1.0)
+
+find_library(DBUSGLIB_LIBRARY
+ NAMES dbus-glib-1
+ HINTS ${PC_LibDBUSGLIB_LIBDIR}
+)
+
+set(DBUSGLIB_LIBRARIES ${DBUSGLIB_LIBRARY})
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(DBUSGLIB DEFAULT_MSG DBUSGLIB_LIBRARIES DBUSGLIB_INCLUDE_DIR)
+
+mark_as_advanced(DBUSGLIB_INCLUDE_DIR DBUSGLIB_LIBRARIES)