forked from ElektraInitiative/libelektra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
44 lines (36 loc) · 1.15 KB
/
CMakeLists.txt
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
if (DEPENDENCY_PHASE)
find_package (DBus QUIET)
if (NOT DBUS_FOUND)
remove_plugin (dbus "dbus package not found")
endif ()
endif ()
add_plugin (dbus
SOURCES dbus.h
dbus.c
sendmessage.c
INCLUDE_DIRECTORIES ${DBUS_INCLUDE_DIR}
${DBUS_ARCH_INCLUDE_DIR}
LINK_LIBRARIES ${DBUS_LIBRARIES})
add_plugintest (dbus
testmod_dbus.c
receivemessage.c
INCLUDE_DIRECTORIES ${DBUS_INCLUDE_DIR}
${DBUS_ARCH_INCLUDE_DIR})
if (ADDTESTING_PHASE)
set (example example_dbus)
set (SRC_FILES
${CMAKE_CURRENT_SOURCE_DIR}/example_dbus.c
${CMAKE_CURRENT_SOURCE_DIR}/sendmessage.c
${CMAKE_CURRENT_SOURCE_DIR}/receivemessage.c)
set (HDR_FILES ${CMAKE_CURRENT_SOURCE_DIR}/dbus.h)
add_headers (ELEKTRA_HEADERS)
set (SOURCES ${SRC_FILES} ${HDR_FILES} ${ELEKTRA_HEADERS})
add_executable (${example} ${SOURCES})
add_dependencies (${example} kdberrors_generated elektra_error_codes_generated)
target_include_directories (${example}
SYSTEM
PUBLIC ${DBUS_INCLUDE_DIR}
${DBUS_ARCH_INCLUDE_DIR})
target_link_libraries (${example} ${DBUS_LIBRARIES})
target_link_elektra (${example} elektra-kdb)
endif ()