-
Notifications
You must be signed in to change notification settings - Fork 6
/
FindDBus.cmake
39 lines (33 loc) · 1.3 KB
/
FindDBus.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# - Try to find the dbus library
# Once done this will define
#
# DBUS_FOUND - system has sqlite
# DBUS_INCLUDE_DIR - the sqlite include directory
# DBUS_LIBRARIES - Link these to use sqlite
# DBUS_DEFINITIONS - Compiler switches required for using sqlite
#
IF ( DBUS_INCLUDE_DIR AND DBUS_LIBRARIES )
SET( DBUS_FIND_QUIETLY TRUE )
ENDIF ( DBUS_INCLUDE_DIR AND DBUS_LIBRARIES )
IF ( NOT WIN32 )
INCLUDE( UsePkgConfig )
PKGCONFIG( dbus-1 _LibDBusIncDir _LibDBUSLinkDir _LibDBUSLinkFlags _LibDBUSCflags )
ENDIF ( NOT WIN32 )
# Look for dbus-1 include dir and libraries
MESSAGE( ${_LibDBusIncDir})
FIND_PATH(DBUS_INCLUDE_DIR dbus/dbus.h ${_LibDBusIncDir} )
MESSAGE(${DBUS_INCLUDE_DIR})
FIND_LIBRARY( DBUS_LIBRARIES NAMES dbus-1 PATHS ${_LibDUBSLinkDir} )
MESSAGE(${DBUS_LIBRARIES})
IF ( DBUS_INCLUDE_DIR AND DBUS_LIBRARIES )
SET( DBUS_FOUND 1 )
IF ( NOT DBUS_FIND_QUIETLY )
MESSAGE ( STATUS "Found DBus: ${DBUS_LIBRARIES}" )
ENDIF ( NOT DBUS_FIND_QUIETLY )
ELSE ( DBUS_INCLUDE_DIR AND DBUS_LIBRARIES )
IF ( NOT DBUS_FIND_QUIETLY )
MESSAGE ( STATUS "Could NOT found dbus." )
ENDIF ( NOT DBUS_FIND_QUIETLY )
ENDIF ( DBUS_INCLUDE_DIR AND DBUS_LIBRARIES )
# Hide advanced variables from CMake GUIs
MARK_AS_ADVANCED( DBUS_INCLUDE_DIR DBUS_LIBRARIES )