blob: eb0e2189a0324562d9e19b2c2245ab257f026139 (
plain)
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
|
SET(DBUS_DIR ../../dbus)
configure_file(${DBUS_DIR}/dbus-arch-deps.h.in ${CMAKE_CURRENT_BINARY_DIR}/dbus-arch-deps.h )
add_definitions(-DDBUS_COMPILATION)
set (dbusinclude_HEADERS
${DBUS_DIR}/dbus.h
${DBUS_DIR}/dbus-address.h
${DBUS_DIR}/dbus-bus.h
${DBUS_DIR}/dbus-connection.h
${DBUS_DIR}/dbus-errors.h
${DBUS_DIR}/dbus-macros.h
${DBUS_DIR}/dbus-memory.h
${DBUS_DIR}/dbus-message.h
${DBUS_DIR}/dbus-misc.h
${DBUS_DIR}/dbus-pending-call.h
${DBUS_DIR}/dbus-protocol.h
${DBUS_DIR}/dbus-server.h
${DBUS_DIR}/dbus-shared.h
${DBUS_DIR}/dbus-signature.h
${DBUS_DIR}/dbus-syntax.h
${DBUS_DIR}/dbus-threads.h
${DBUS_DIR}/dbus-types.h
)
set (dbusinclude_ARCH_HEADERS
${CMAKE_CURRENT_BINARY_DIR}/dbus-arch-deps.h
)
### source code that goes in the installed client library
### and is specific to library functionality
set (DBUS_LIB_SOURCES
${DBUS_DIR}/dbus-address.c
${DBUS_DIR}/dbus-auth.c
${DBUS_DIR}/dbus-bus.c
${DBUS_DIR}/dbus-connection.c
${DBUS_DIR}/dbus-credentials.c
${DBUS_DIR}/dbus-errors.c
${DBUS_DIR}/dbus-keyring.c
${DBUS_DIR}/dbus-marshal-header.c
${DBUS_DIR}/dbus-marshal-byteswap.c
${DBUS_DIR}/dbus-marshal-recursive.c
${DBUS_DIR}/dbus-marshal-validate.c
${DBUS_DIR}/dbus-message.c
${DBUS_DIR}/dbus-misc.c
${DBUS_DIR}/dbus-nonce.c
${DBUS_DIR}/dbus-object-tree.c
${DBUS_DIR}/dbus-pending-call.c
${DBUS_DIR}/dbus-resources.c
${DBUS_DIR}/dbus-server.c
${DBUS_DIR}/dbus-server-socket.c
${DBUS_DIR}/dbus-server-debug-pipe.c
${DBUS_DIR}/dbus-sha.c
${DBUS_DIR}/dbus-signature.c
${DBUS_DIR}/dbus-syntax.c
${DBUS_DIR}/dbus-timeout.c
${DBUS_DIR}/dbus-threads.c
${DBUS_DIR}/dbus-transport.c
${DBUS_DIR}/dbus-transport-socket.c
${DBUS_DIR}/dbus-watch.c
)
if(UNIX)
set (DBUS_LIB_SOURCES ${DBUS_LIB_SOURCES}
${DBUS_DIR}/dbus-transport-unix.c
${DBUS_DIR}/dbus-server-unix.c
)
else(UNIX)
set (DBUS_LIB_SOURCES ${DBUS_LIB_SOURCES}
${DBUS_DIR}/dbus-transport-win.c
${DBUS_DIR}/dbus-server-win.c
)
endif(UNIX)
set (DBUS_LIB_HEADERS
${DBUS_DIR}/dbus-auth.h
${DBUS_DIR}/dbus-connection-internal.h
${DBUS_DIR}/dbus-credentials.h
${DBUS_DIR}/dbus-keyring.h
${DBUS_DIR}/dbus-marshal-header.h
${DBUS_DIR}/dbus-marshal-byteswap.h
${DBUS_DIR}/dbus-marshal-recursive.h
${DBUS_DIR}/dbus-marshal-validate.h
${DBUS_DIR}/dbus-message-internal.h
${DBUS_DIR}/dbus-message-private.h
${DBUS_DIR}/dbus-misc.h
${DBUS_DIR}/dbus-object-tree.h
${DBUS_DIR}/dbus-protocol.h
${DBUS_DIR}/dbus-resources.h
${DBUS_DIR}/dbus-server-debug-pipe.h
${DBUS_DIR}/dbus-server-protected.h
${DBUS_DIR}/dbus-server-unix.h
${DBUS_DIR}/dbus-sha.h
${DBUS_DIR}/dbus-timeout.h
${DBUS_DIR}/dbus-threads.h
${DBUS_DIR}/dbus-threads-internal.h
${DBUS_DIR}/dbus-transport.h
${DBUS_DIR}/dbus-transport-protected.h
${DBUS_DIR}/dbus-watch.h
${CMAKE_BINARY_DIR}/config.h
)
if(UNIX)
set (DBUS_LIB_HEADERS ${DBUS_LIB_HEADERS}
${DBUS_DIR}/dbus-transport-unix.h
)
else(UNIX)
set (DBUS_LIB_HEADERS ${DBUS_LIB_HEADERS}
${DBUS_DIR}/dbus-transport-win.h
)
endif(UNIX)
### source code that goes in the installed client library
### AND is generic utility functionality used by the
### daemon or test programs (all symbols in here should
### be underscore-prefixed)
set (DBUS_SHARED_SOURCES
${DBUS_DIR}/dbus-dataslot.c
${DBUS_DIR}/dbus-file.c
${DBUS_DIR}/dbus-hash.c
${DBUS_DIR}/dbus-internals.c
${DBUS_DIR}/dbus-list.c
${DBUS_DIR}/dbus-marshal-basic.c
${DBUS_DIR}/dbus-memory.c
${DBUS_DIR}/dbus-mempool.c
${DBUS_DIR}/dbus-string.c
${DBUS_DIR}/dbus-sysdeps.c
${DBUS_DIR}/dbus-pipe.c
${DBUS_DIR}/dbus-test-tap.c
)
set (DBUS_SHARED_HEADERS
${DBUS_DIR}/dbus-dataslot.h
${DBUS_DIR}/dbus-file.h
${DBUS_DIR}/dbus-hash.h
${DBUS_DIR}/dbus-internals.h
${DBUS_DIR}/dbus-list.h
${DBUS_DIR}/dbus-marshal-basic.h
${DBUS_DIR}/dbus-mempool.h
${DBUS_DIR}/dbus-string.h
${DBUS_DIR}/dbus-string-private.h
${DBUS_DIR}/dbus-pipe.h
${DBUS_DIR}/dbus-sysdeps.h
${DBUS_DIR}/dbus-test-tap.h
)
### source code that is generic utility functionality used
### by the bus daemon or test apps, but is NOT included
### in the D-BUS client library (all symbols in here
### should be underscore-prefixed but don't really need
### to be unless they move to DBUS_SHARED_SOURCES later)
set (DBUS_UTIL_SOURCES
${DBUS_DIR}/dbus-asv-util.c
${DBUS_DIR}/dbus-auth-script.c
${DBUS_DIR}/dbus-auth-util.c
${DBUS_DIR}/dbus-credentials-util.c
${DBUS_DIR}/dbus-mainloop.c
${DBUS_DIR}/dbus-marshal-byteswap-util.c
${DBUS_DIR}/dbus-marshal-recursive-util.c
${DBUS_DIR}/dbus-marshal-validate-util.c
${DBUS_DIR}/dbus-message-factory.c
${DBUS_DIR}/dbus-message-util.c
${DBUS_DIR}/dbus-shell.c
${DBUS_DIR}/dbus-socket-set.c
${DBUS_DIR}/dbus-socket-set-poll.c
${DBUS_DIR}/dbus-string-util.c
${DBUS_DIR}/dbus-sysdeps-util.c
)
if (DBUS_ENABLE_EMBEDDED_TESTS)
set (DBUS_UTIL_SOURCES
${DBUS_UTIL_SOURCES}
${DBUS_DIR}/dbus-test.c
${DBUS_DIR}/dbus-spawn-test.c
)
endif (DBUS_ENABLE_EMBEDDED_TESTS)
set (DBUS_UTIL_HEADERS
${DBUS_DIR}/dbus-asv-util.h
${DBUS_DIR}/dbus-auth-script.h
${DBUS_DIR}/dbus-mainloop.h
${DBUS_DIR}/dbus-message-factory.h
${DBUS_DIR}/dbus-shell.h
${DBUS_DIR}/dbus-socket-set.h
${DBUS_DIR}/dbus-spawn.h
${DBUS_DIR}/dbus-test.h
)
### platform specific settings
if (WIN32)
set (DBUS_SHARED_SOURCES ${DBUS_SHARED_SOURCES}
${DBUS_DIR}/dbus-file-win.c
${DBUS_DIR}/dbus-init-win.cpp
${DBUS_DIR}/dbus-sysdeps-win.c
${DBUS_DIR}/dbus-pipe-win.c
${DBUS_DIR}/dbus-sysdeps-thread-win.c
)
set (DBUS_SHARED_HEADERS ${DBUS_SHARED_HEADERS}
${DBUS_DIR}/dbus-sockets-win.h
${DBUS_DIR}/dbus-sysdeps-win.h
)
set (DBUS_UTIL_SOURCES ${DBUS_UTIL_SOURCES}
${DBUS_DIR}/dbus-spawn-win.c
${DBUS_DIR}/dbus-sysdeps-util-win.c
)
if(WINCE)
set (DBUS_SHARED_SOURCES ${DBUS_SHARED_SOURCES}
${DBUS_DIR}/dbus-sysdeps-wince-glue.c
)
set (DBUS_SHARED_HEADERS ${DBUS_SHARED_HEADERS}
${DBUS_DIR}/dbus-sysdeps-wince-glue.h
)
endif(WINCE)
else (WIN32)
set (DBUS_SHARED_SOURCES ${DBUS_SHARED_SOURCES}
${DBUS_DIR}/dbus-file-unix.c
${DBUS_DIR}/dbus-pipe-unix.c
${DBUS_DIR}/dbus-sysdeps-unix.c
${DBUS_DIR}/dbus-sysdeps-pthread.c
${DBUS_DIR}/dbus-userdb.c
)
set (DBUS_SHARED_HEADERS ${DBUS_SHARED_HEADERS}
${DBUS_DIR}/dbus-server-unix.h
${DBUS_DIR}/dbus-transport-unix.h
${DBUS_DIR}/dbus-sysdeps-unix.h
${DBUS_DIR}/dbus-userdb.h
)
set (DBUS_UTIL_SOURCES ${DBUS_UTIL_SOURCES}
${DBUS_DIR}/dbus-spawn-unix.c
${DBUS_DIR}/dbus-userdb-util.c
${DBUS_DIR}/dbus-sysdeps-util-unix.c
)
endif (WIN32)
if(DBUS_HAVE_LINUX_EPOLL)
set(DBUS_UTIL_SOURCES
${DBUS_UTIL_SOURCES}
${DBUS_DIR}/dbus-socket-set-epoll.c
)
endif()
set(libdbus_SOURCES
${DBUS_LIB_SOURCES}
${DBUS_SHARED_SOURCES}
)
set(libdbus_HEADERS
${DBUS_LIB_HEADERS}
${DBUS_SHARED_HEADERS}
)
if(DEFINED DBUS_LIBRARY_REVISION)
math(EXPR DBUS_LIBRARY_MAJOR "${DBUS_LIBRARY_CURRENT} - ${DBUS_LIBRARY_AGE}")
endif()
if(WIN32)
set(DBUS_VER_INTERNAL_NAME "${CMAKE_SHARED_LIBRARY_PREFIX}dbus-1-${DBUS_LIBRARY_MAJOR}")
set(DBUS_VER_ORIGINAL_NAME "${DBUS_VER_INTERNAL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}")
set(DBUS_VER_FILE_TYPE "VFT_DLL")
configure_file(${DBUS_DIR}/versioninfo.rc.in ${CMAKE_CURRENT_BINARY_DIR}/versioninfo.rc)
list(APPEND libdbus_SOURCES versioninfo.rc)
endif()
if(MSVC_IDE)
project_source_group(${GROUP_CODE} DBUS_LIB_SOURCES DBUS_LIB_HEADERS)
project_source_group(${GROUP_CODE} DBUS_SHARED_SOURCES DBUS_SHARED_HEADERS)
project_source_group(${GROUP_CODE} DBUS_UTIL_SOURCES DBUS_UTIL_SOURCES)
endif(MSVC_IDE)
# for clock_getres() on e.g. GNU/Linux (but not Android)
find_library(LIBRT rt)
# for socket() on QNX
find_library(LIBSOCKET socket)
### Client library
add_library(dbus-1 SHARED
${libdbus_SOURCES}
${libdbus_HEADERS}
)
if(WIN32)
if(DEFINED DBUS_LIBRARY_REVISION)
set_target_properties(dbus-1 PROPERTIES SUFFIX "-${DBUS_LIBRARY_MAJOR}${CMAKE_SHARED_LIBRARY_SUFFIX}")
add_custom_command(TARGET dbus-1 POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:dbus-1>" "$<TARGET_FILE_DIR:dbus-1>/${CMAKE_SHARED_LIBRARY_PREFIX}dbus-1${CMAKE_SHARED_LIBRARY_SUFFIX}"
COMMENT "Create non versioned dbus-1 library for legacy applications"
)
install(FILES ${LEGACY_FILE_NAME} DESTINATION bin)
endif()
if(WINCE)
target_link_libraries(dbus-1 ws2)
else(WINCE)
target_link_libraries(dbus-1 ws2_32 advapi32 netapi32 iphlpapi dbghelp)
endif(WINCE)
else(WIN32)
if(DEFINED DBUS_LIBRARY_REVISION)
set_target_properties(dbus-1 PROPERTIES VERSION ${DBUS_LIBRARY_MAJOR}.${DBUS_LIBRARY_AGE}.${DBUS_LIBRARY_REVISION} SOVERSION ${DBUS_LIBRARY_MAJOR})
endif()
target_link_libraries(dbus-1 ${CMAKE_THREAD_LIBS_INIT})
if(LIBRT)
target_link_libraries(dbus-1 ${LIBRT})
endif()
if(LIBSOCKET)
target_link_libraries(dbus-1 ${LIBSOCKET})
endif()
endif(WIN32)
# Assume that Linux has -Wl,--version-script and other platforms do not
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
set(SOVERSION ${DBUS_LIBRARY_MAJOR})
configure_file(${DBUS_DIR}/Version.in ${CMAKE_CURRENT_BINARY_DIR}/Version)
set_target_properties(dbus-1 PROPERTIES LINK_FLAGS -Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/Version)
endif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
install(TARGETS dbus-1 ${INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES ${dbusinclude_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dbus-1.0/dbus)
install(FILES ${dbusinclude_ARCH_HEADERS} DESTINATION ${CMAKE_INSTALL_LIBDIR}/dbus-1.0/include/dbus)
### Internal library, used for the daemon, tools and tests, compiled statically.
add_library(dbus-internal ${DBUS_INTERNAL_ADD_LIBRARY_OPTIONS}
${DBUS_UTIL_SOURCES}
${DBUS_UTIL_HEADERS}
)
target_link_libraries(dbus-internal dbus-1)
if(WIN32)
if(WINCE)
target_link_libraries(dbus-internal ws2)
else(WINCE)
target_link_libraries(dbus-internal ws2_32 advapi32 netapi32 iphlpapi)
endif(WINCE)
else(WIN32)
target_link_libraries(dbus-internal ${CMAKE_THREAD_LIBS_INIT})
if(LIBRT)
target_link_libraries(dbus-internal ${LIBRT})
endif()
if(LIBSOCKET)
target_link_libraries(dbus-internal ${LIBSOCKET})
endif()
endif(WIN32)
if (DBUS_ENABLE_EMBEDDED_TESTS)
add_test_executable(test-dbus ${CMAKE_SOURCE_DIR}/../dbus/dbus-test-main.c ${DBUS_INTERNAL_LIBRARIES})
set_target_properties(test-dbus PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
ENDIF (DBUS_ENABLE_EMBEDDED_TESTS)
if (UNIX)
# set version info
ENDIF (UNIX)
## mop up the gcov files
#clean-local:
#/bin/rm *.bb *.bbg *.da *.gcov .libs/*.da .libs/*.bbg || true
|