1
# - Try to find the low-level D-Bus library
2
# Once done this will define
4
# DBUS_FOUND - system has D-Bus
5
# DBUS_INCLUDE_DIR - the D-Bus include directory
6
# DBUS_ARCH_INCLUDE_DIR - the D-Bus architecture-specific include directory
7
# DBUS_LIBRARIES - the libraries needed to use D-Bus
9
# Copyright (c) 2008, Kevin Kofler, <kevin.kofler@chello.at>
10
# modeled after FindLibArt.cmake:
11
# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
13
# Redistribution and use is allowed according to the terms of the BSD license.
14
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
16
if (DBUS_INCLUDE_DIR AND DBUS_ARCH_INCLUDE_DIR AND DBUS_LIBRARIES)
21
else (DBUS_INCLUDE_DIR AND DBUS_ARCH_INCLUDE_DIR AND DBUS_LIBRARIES)
24
FIND_PACKAGE(PkgConfig)
26
# use pkg-config to get the directories and then use these values
27
# in the FIND_PATH() and FIND_LIBRARY() calls
28
pkg_check_modules(_DBUS_PC QUIET dbus-1)
29
ENDIF (PKG_CONFIG_FOUND)
32
FIND_PATH(DBUS_INCLUDE_DIR dbus/dbus.h
33
${_DBUS_PC_INCLUDE_DIRS}
39
FIND_PATH(DBUS_ARCH_INCLUDE_DIR dbus/dbus-arch-deps.h
40
${_DBUS_PC_INCLUDE_DIRS}
41
/usr/lib${LIB_SUFFIX}/include
42
/usr/lib${LIB_SUFFIX}/dbus-1.0/include
44
/usr/lib64/dbus-1.0/include
46
/usr/lib/dbus-1.0/include
49
FIND_LIBRARY(DBUS_LIBRARIES NAMES dbus-1 dbus
55
if (DBUS_INCLUDE_DIR AND DBUS_ARCH_INCLUDE_DIR AND DBUS_LIBRARIES)
57
endif (DBUS_INCLUDE_DIR AND DBUS_ARCH_INCLUDE_DIR AND DBUS_LIBRARIES)
61
if (NOT DBus_FIND_QUIETLY)
62
message(STATUS "Found D-Bus: ${DBUS_LIBRARIES}")
63
endif (NOT DBus_FIND_QUIETLY)
65
if (DBus_FIND_REQUIRED)
66
message(FATAL_ERROR "Could NOT find D-Bus")
67
endif (DBus_FIND_REQUIRED)
70
MARK_AS_ADVANCED(DBUS_INCLUDE_DIR DBUS_ARCH_INCLUDE_DIR DBUS_LIBRARIES)
72
endif (DBUS_INCLUDE_DIR AND DBUS_ARCH_INCLUDE_DIR AND DBUS_LIBRARIES)