3 #INCLUDES=-I$(top_srcdir) $(DBUS_CLIENT_CFLAGS) -DDBUS_COMPILATION
5 include_directories(${CMAKE_SOURCE_DIR}/..)
6 SET(DBUS_DIR ${CMAKE_SOURCE_DIR}/../dbus)
8 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/dbus-arch-deps.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/dbus-arch-deps.h )
10 add_definitions(-DDBUS_COMPILATION)
12 set (dbusinclude_HEADERS
14 ${DBUS_DIR}/dbus-address.h
15 ${DBUS_DIR}/dbus-bus.h
16 ${DBUS_DIR}/dbus-connection.h
17 ${DBUS_DIR}/dbus-errors.h
18 ${DBUS_DIR}/dbus-macros.h
19 ${DBUS_DIR}/dbus-memory.h
20 ${DBUS_DIR}/dbus-message.h
21 ${DBUS_DIR}/dbus-misc.h
22 ${DBUS_DIR}/dbus-pending-call.h
23 ${DBUS_DIR}/dbus-protocol.h
24 ${DBUS_DIR}/dbus-server.h
25 ${DBUS_DIR}/dbus-shared.h
26 ${DBUS_DIR}/dbus-signature.h
27 ${DBUS_DIR}/dbus-threads.h
28 ${DBUS_DIR}/dbus-types.h
32 ### source code that goes in the installed client library
33 ### and is specific to library functionality
35 ${DBUS_DIR}/dbus-address.c
36 ${DBUS_DIR}/dbus-auth.c
37 ${DBUS_DIR}/dbus-auth-script.c
38 ${DBUS_DIR}/dbus-bus.c
39 ${DBUS_DIR}/dbus-connection.c
40 ${DBUS_DIR}/dbus-errors.c
41 ${DBUS_DIR}/dbus-keyring.c
42 ${DBUS_DIR}/dbus-marshal-header.c
43 ${DBUS_DIR}/dbus-marshal-byteswap.c
44 ${DBUS_DIR}/dbus-marshal-recursive.c
45 ${DBUS_DIR}/dbus-marshal-validate.c
46 ${DBUS_DIR}/dbus-message.c
47 ${DBUS_DIR}/dbus-misc.c
48 ${DBUS_DIR}/dbus-object-tree.c
49 ${DBUS_DIR}/dbus-pending-call.c
50 ${DBUS_DIR}/dbus-resources.c
51 ${DBUS_DIR}/dbus-server.c
52 ${DBUS_DIR}/dbus-server-socket.c
53 ${DBUS_DIR}/dbus-server-debug-pipe.c
54 ${DBUS_DIR}/dbus-sha.c
55 ${DBUS_DIR}/dbus-signature.c
56 ${DBUS_DIR}/dbus-timeout.c
57 ${DBUS_DIR}/dbus-threads.c
58 ${DBUS_DIR}/dbus-transport.c
59 ${DBUS_DIR}/dbus-transport-socket.c
60 ${DBUS_DIR}/dbus-watch.c
63 # find a clean Windows implementation
64 # and move code to a *-win.c file
67 set (DBUS_LIB_SOURCES ${DBUS_LIB_SOURCES}
68 ${DBUS_DIR}/dbus-transport-unix.c
69 ${DBUS_DIR}/dbus-server-unix.c
72 set (DBUS_LIB_SOURCES ${DBUS_LIB_SOURCES}
73 # ${DBUS_DIR}/dbus-transport-win.c
74 ${DBUS_DIR}/dbus-server-win.c
79 ${DBUS_DIR}/dbus-auth.h
80 ${DBUS_DIR}/dbus-auth-script.h
81 ${DBUS_DIR}/dbus-connection-internal.h
82 ${DBUS_DIR}/dbus-keyring.h
83 ${DBUS_DIR}/dbus-marshal-header.h
84 ${DBUS_DIR}/dbus-marshal-byteswap.h
85 ${DBUS_DIR}/dbus-marshal-recursive.h
86 ${DBUS_DIR}/dbus-marshal-validate.h
87 ${DBUS_DIR}/dbus-message-internal.h
88 ${DBUS_DIR}/dbus-message-private.h
89 ${DBUS_DIR}/dbus-misc.h
90 ${DBUS_DIR}/dbus-object-tree.h
91 ${DBUS_DIR}/dbus-protocol.h
92 ${DBUS_DIR}/dbus-resources.h
93 ${DBUS_DIR}/dbus-server-debug-pipe.h
94 ${DBUS_DIR}/dbus-server-protected.h
95 ${DBUS_DIR}/dbus-server-unix.h
96 ${DBUS_DIR}/dbus-sha.h
97 ${DBUS_DIR}/dbus-timeout.h
98 ${DBUS_DIR}/dbus-threads.h
99 ${DBUS_DIR}/dbus-threads-internal.h
100 ${DBUS_DIR}/dbus-transport.h
101 ${DBUS_DIR}/dbus-transport-protected.h
102 ${DBUS_DIR}/dbus-transport-unix.h
103 ${DBUS_DIR}/dbus-watch.h
104 ${CMAKE_BINARY_DIR}/config.h
107 ### source code that goes in the installed client library
108 ### AND is generic utility functionality used by the
109 ### daemon or test programs (all symbols in here should
110 ### be underscore-prefixed)
111 set (DBUS_SHARED_SOURCES
112 ${DBUS_DIR}/dbus-dataslot.c
113 ${DBUS_DIR}/dbus-hash.c
114 ${DBUS_DIR}/dbus-internals.c
115 ${DBUS_DIR}/dbus-list.c
116 ${DBUS_DIR}/dbus-marshal-basic.c
117 ${DBUS_DIR}/dbus-memory.c
118 ${DBUS_DIR}/dbus-mempool.c
119 ${DBUS_DIR}/dbus-string.c
120 ${DBUS_DIR}/dbus-sysdeps.c
121 ${DBUS_DIR}/dbus-sysdeps-util.c
122 ${DBUS_DIR}/dbus-userdb.c
125 set (DBUS_SHARED_HEADERS
126 ${DBUS_DIR}/dbus-dataslot.h
127 ${DBUS_DIR}/dbus-hash.h
128 ${DBUS_DIR}/dbus-internals.h
129 ${DBUS_DIR}/dbus-list.h
130 ${DBUS_DIR}/dbus-marshal-basic.h
131 ${DBUS_DIR}/dbus-mempool.h
132 ${DBUS_DIR}/dbus-string.h
133 ${DBUS_DIR}/dbus-string-private.h
134 ${DBUS_DIR}/dbus-sysdeps.h
135 ${DBUS_DIR}/dbus-userdb.h
138 ### source code that is generic utility functionality used
139 ### by the bus daemon or test apps, but is NOT included
140 ### in the D-BUS client library (all symbols in here
141 ### should be underscore-prefixed but don't really need
142 ### to be unless they move to DBUS_SHARED_SOURCES later)
143 set (DBUS_UTIL_SOURCES
144 ${DBUS_DIR}/dbus-auth-util.c
145 ${DBUS_DIR}/dbus-mainloop.c
146 ${DBUS_DIR}/dbus-marshal-byteswap-util.c
147 ${DBUS_DIR}/dbus-marshal-recursive-util.c
148 ${DBUS_DIR}/dbus-marshal-validate-util.c
149 ${DBUS_DIR}/dbus-message-factory.c
150 ${DBUS_DIR}/dbus-message-util.c
151 ${DBUS_DIR}/dbus-shell.c
152 ${DBUS_DIR}/dbus-string-util.c
153 ${DBUS_DIR}/dbus-userdb-util.c
156 if (DBUS_BUILD_TESTS)
157 set (DBUS_UTIL_SOURCES
159 ${DBUS_DIR}/dbus-test.c
161 endif (DBUS_BUILD_TESTS)
163 set (DBUS_UTIL_HEADERS
164 ${DBUS_DIR}/dbus-mainloop.h
165 ${DBUS_DIR}/dbus-message-factory.h
166 ${DBUS_DIR}/dbus-shell.h
167 ${DBUS_DIR}/dbus-spawn.h
168 ${DBUS_DIR}/dbus-test.h
171 ### platform specific settings
173 set (DBUS_SHARED_SOURCES ${DBUS_SHARED_SOURCES}
174 ${DBUS_DIR}/dbus-sysdeps-win.c
175 ${DBUS_DIR}/dbus-sysdeps-thread-win.c
176 ${DBUS_DIR}/dbus-sysdeps-util-win.c
177 ${DBUS_DIR}/dbus-spawn-win.c
179 set (DBUS_SHARED_HEADERS ${DBUS_SHARED_HEADERS}
180 ${DBUS_DIR}/dbus-sockets-win.h
181 ${DBUS_DIR}/dbus-sysdeps-win.h
183 set (LIBS ${LIBS} ws2_32 advapi32 netapi32)
186 set (DBUS_SHARED_SOURCES ${DBUS_SHARED_SOURCES}
187 ${DBUS_DIR}/dbus-sysdeps-unix.c
188 ${DBUS_DIR}/dbus-sysdeps-pthread.c
189 ${DBUS_DIR}/dbus-sysdeps-util-unix.c
190 ${DBUS_DIR}/dbus-spawn.c
192 set (DBUS_SHARED_HEADERS ${DBUS_SHARED_HEADERS}
193 ${DBUS_DIR}/dbus-server-unix.h
194 ${DBUS_DIR}/dbus-transport-unix.h
195 ${DBUS_DIR}/dbus-sysdeps-unix.h
201 ${DBUS_SHARED_SOURCES}
208 ${DBUS_SHARED_HEADERS}
214 add_library(dbus-1 STATIC ${libdbus_SOURCES} ${libdbus_HEADERS} )
215 project_source_group(${GROUP_CODE} libdbus_SOURCES libdbus_HEADERS)
217 add_library(dbus-1 ${libdbus_SOURCES} ${libdbus_HEADERS} )
220 target_link_libraries(dbus-1 ${LIBS} )
222 install_targets(/lib dbus-1 )
223 install_files(/include/dbus FILES ${dbusinclude_HEADERS})
225 #ADD_EXECUTABLE(dbus-example dbus-example.c)
226 #target_link_libraries(${CMAKE_SOURCE_DIR}/../dbus/dbus-example dbus-1)
227 #install_targets(/bin dbus-example )
229 ## note that TESTS has special meaning (stuff to use in make check)
230 ## so if adding tests not to be run in make check, don't add them to
233 #TESTS_ENVIRONMENT=DBUS_TEST_DATA=$(top_builddir)/test/data DBUS_TEST_HOMEDIR=$(top_builddir)/dbus
239 if (DBUS_BUILD_TESTS)
240 set (TESTS_ENVIRONMENT "DBUS_TEST_DATA=${CMAKE_SOURCE_DIR}/test/data DBUS_TEST_HOMEDIR=${CMAKE_BUILD_DIR}/dbus")
241 ADD_EXECUTABLE(dbus-test ${CMAKE_SOURCE_DIR}/../dbus/dbus-test-main.c)
242 target_link_libraries(dbus-test dbus-1 ${LIBS})
243 add_test(dbus-test ${EXECUTABLE_OUTPUT_PATH}/dbus-test ${CMAKE_SOURCE_DIR}/../test/data)
244 #install_targets(/bin dbus-test)
245 ENDIF (DBUS_BUILD_TESTS)
252 ## mop up the gcov files
254 #/bin/rm *.bb *.bbg *.da *.gcov .libs/*.da .libs/*.bbg || true