[Release] Webkit2-efl-123997_0.11.46
[framework/web/webkit-efl.git] / Source / cmake / FindDBUS-1.cmake
1 # - Try to find DBus-1
2 # Once done, this will define
3 #
4 #  DBUS-1_FOUND - system has dbus-1
5 #  DBUS-1_INCLUDE_DIRS - the dbus-1 include directories
6 #  DBUS-1_LIBRARIES - link these to use dbus-1
7
8 include(LibFindMacros)
9
10 # Use pkg-config to get hints about paths
11 libfind_pkg_check_modules(DBUS-1_PKGCONF dbus-1)
12
13 # Include dir
14 find_path(DBUS-1_MAIN_INCLUDE_DIR
15   NAMES dbus/dbus.h
16   PATHS ${DBUS-1_PKGCONF_INCLUDE_DIRS}
17 )
18
19 find_path(DBUS-1_ARCH_INCLUDE_DIR
20   NAMES dbus/dbus-arch-deps.h
21   PATHS ${DBUS-1_PKGCONF_INCLUDE_DIRS}
22 )
23
24 SET(DBUS-1_INCLUDE_DIR
25   ${DBUS-1_MAIN_INCLUDE_DIR}
26   ${DBUS-1_ARCH_INCLUDE_DIR}
27 )
28
29 # Finally the library itself
30 find_library(DBUS-1_LIBRARY
31   NAMES dbus-1
32   PATHS ${DBUS-1_PKGCONF_LIBRARY_DIRS}
33 )
34
35 # Set the include dir variables and the libraries and let libfind_process do the rest.
36 # NOTE: Singular variables for this library, plural for libraries this this lib depends on.
37 set(DBUS-1_PROCESS_INCLUDES DBUS-1_INCLUDE_DIR DBUS-1_INCLUDE_DIRS)
38 set(DBUS-1_PROCESS_LIBS DBUS-1_LIBRARY DBUS-1_LIBRARIES)
39 libfind_process(DBUS-1)