File: FindDbus.cmake

package info (click to toggle)
obdgpslogger 0.16-1.3
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 5,160 kB
  • ctags: 7,498
  • sloc: ansic: 73,206; cpp: 2,055; php: 407; sh: 51; makefile: 4
file content (47 lines) | stat: -rw-r--r-- 1,037 bytes parent folder | download | duplicates (2)
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
40
41
42
43
44
45
46
47
SET(DBUS_FOUND "NO")

SET(DBUS_PREFIX "/usr/local/dbus/" CACHE STRING
	"DBUS is installed in this prefix (if non-standard)")

SET(DBUS_SEARCH_PATHS
	${DBUS_PREFIX}/
	/sw/
	/usr/
	/usr/local/
)

FIND_PATH(DBUS_INCLUDE_DIR1
	NAMES dbus/dbus.h
	PATH_SUFFIXES /include/ /include/dbus-1.0/
	PATHS ${DBUS_SEARCH_PATHS}
)

FIND_PATH(DBUS_INCLUDE_DIR2
	NAMES dbus/dbus-arch-deps.h
	PATH_SUFFIXES /include/ /include/dbus-1.0/ /lib/dbus-1.0/include/
	PATHS ${DBUS_SEARCH_PATHS}
)

SET(DBUS_INCLUDE_DIR ${DBUS_INCLUDE_DIR1} ${DBUS_INCLUDE_DIR2})

FIND_LIBRARY(DBUS_LIBRARY
	NAMES dbus dbus-1
	PATH_SUFFIXES /lib/ /lib/dbus-1.0/
	PATHS ${DBUS_SEARCH_PATHS}
)


IF(DBUS_LIBRARY AND DBUS_INCLUDE_DIR)
  SET(DBUS_FOUND "YES")
ENDIF(DBUS_LIBRARY AND DBUS_INCLUDE_DIR)

IF(DBUS_FOUND)
  IF(NOT DBUS_FIND_QUIETLY)
    MESSAGE(STATUS "Found DBUS: ${DBUS_LIBRARY},${DBUS_LIBRARY}")
  ENDIF(NOT DBUS_FIND_QUIETLY)
ELSE(DBUS_FOUND)
  IF(DBUS_FIND_REQUIRED)
    MESSAGE(FATAL_ERROR "Could not find DBUS Library")
  ENDIF(DBUS_FIND_REQUIRED)
ENDIF(DBUS_FOUND)