This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 123
/
Copy pathCMakeLists.txt
71 lines (56 loc) · 1.98 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
include (LibAddBinding)
if (DEPENDENCY_PHASE)
find_package (DBus QUIET)
if (NOT DBUS_FOUND)
remove_plugin (dbusrecv "dbus package not found")
endif ()
endif ()
add_plugin (
dbusrecv
SOURCES dbusrecv.h dbusrecv.c receivemessage.c
OBJECT_SOURCES $<TARGET_OBJECTS:io-adapter-dbus>
INCLUDE_DIRECTORIES ${DBUS_INCLUDE_DIR} ${DBUS_ARCH_INCLUDE_DIR}
LINK_ELEKTRA elektra-io elektra-invoke
LINK_LIBRARIES ${DBUS_LIBRARIES} COMPONENT libelektra${SO_VERSION}-dbus)
set (NOT_INCLUDED "")
plugin_check_if_included ("${PLUGIN_SHORT_NAME}")
if (DEPENDENCY_PHASE AND NOT NOT_INCLUDED)
if (BUILD_SHARED)
# ~~~
# target_compile_options(elektra-dbusrecv PRIVATE "-fPIC")
# set_property (TARGET ${ADAPTER_OBJECT} PROPERTY CMAKE_POSITION_INDEPENDENT_CODE ON)
# ~~~
endif ()
# ~~~
# if (BUILD_FULL OR BUILD_STATIC)
#
# endif ()
# ~~~
endif ()
if (ADDTESTING_PHASE)
# the test requires an IO binding; using io_uv for now
check_binding_was_added ("io_uv" IS_INCLUDED)
if (BUILD_TESTING AND IS_INCLUDED)
find_package (libuv QUIET)
if (BUILD_FULL OR BUILD_STATIC)
set (STATIC_LIBRARIES ${libuv_LIBRARIES}) # libuv is present; otherwise io_uv bindings would not be added
endif ()
add_plugintest (
dbusrecv
TEST_LINK_LIBRARIES ${STATIC_LIBRARIES}
TEST_LINK_ELEKTRA elektra-io-uv
INCLUDE_SYSTEM_DIRECTORIES ${libuv_INCLUDE_DIRS} COMPONENT libelektra${SO_VERSION}-dbus)
# add sources manually because add_plugintest does not support generator expressions for additional source files
if (BUILD_FULL OR BUILD_STATIC)
# add sources for elektra-io-uv for static and full builds
target_sources (testmod_dbusrecv PRIVATE $<TARGET_OBJECTS:elektra-io-uv-objects>)
endif ()
if (libuv_VERSION VERSION_LESS "1.0")
target_compile_definitions (testmod_dbusrecv PRIVATE "HAVE_LIBUV0")
else ()
target_compile_definitions (testmod_dbusrecv PRIVATE "HAVE_LIBUV1")
endif ()
else ()
message (WARNING "io_uv bindings are required for testing, test deactivated")
endif ()
endif ()