1 add_definitions(-DDBUS_COMPILATION)
4 SET(BUS_DIR ${CMAKE_SOURCE_DIR}/../bus)
6 # config files for installation
7 CONFIGURE_FILE( "${BUS_DIR}/session.conf.in" "${CMAKE_CURRENT_BINARY_DIR}/session.conf" IMMEDIATE @ONLY)
8 CONFIGURE_FILE( "${BUS_DIR}/legacy-config/session.conf.in" "${CMAKE_CURRENT_BINARY_DIR}/legacy-config/session.conf" IMMEDIATE @ONLY)
9 FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/session.d)
12 CONFIGURE_FILE( "${BUS_DIR}/system.conf.in" "${CMAKE_CURRENT_BINARY_DIR}/system.conf" IMMEDIATE @ONLY)
13 CONFIGURE_FILE( "${BUS_DIR}/legacy-config/system.conf.in" "${CMAKE_CURRENT_BINARY_DIR}/legacy-config/system.conf" IMMEDIATE @ONLY)
14 FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/system.d)
17 # copy services for local daemon start to local service dir data/dbus-1/services
18 SET (SERVICE_FILES test/data/valid-service-files)
19 FILE(GLOB FILES "${CMAKE_SOURCE_DIR}/../${SERVICE_FILES}/*.service.in" )
20 FOREACH(FILE ${FILES})
21 GET_FILENAME_COMPONENT(FILENAME ${FILE} NAME_WE)
22 SET (TARGET ${CMAKE_BINARY_DIR}/data/dbus-1/services/${FILENAME}.service)
24 MESSAGE("FROM: ${FILE}\nTO: ${TARGET}\n")
25 ENDIF (CONFIG_VERBOSE)
26 configure_file(${FILE} ${TARGET} )
29 SET (XML_SOURCES ${BUS_DIR}/config-loader-expat.c)
31 if (DBUS_BUS_ENABLE_INOTIFY)
32 set (DIR_WATCH_SOURCE ${BUS_DIR}/dir-watch-inotify.c)
33 elseif (DBUS_BUS_ENABLE_KQUEUE)
34 set (DIR_WATCH_SOURCE ${BUS_DIR}/dir-watch-kqueue.c)
35 else (DBUS_BUS_ENABLE_INOTIFY)
36 set (DIR_WATCH_SOURCE ${BUS_DIR}/dir-watch-default.c)
37 endif (DBUS_BUS_ENABLE_INOTIFY)
40 ${BUS_DIR}/activation.c
41 ${BUS_DIR}/activation.h
48 ${BUS_DIR}/config-parser.c
49 ${BUS_DIR}/config-parser.h
50 ${BUS_DIR}/config-parser-common.c
51 ${BUS_DIR}/config-parser-common.h
52 # ${BUS_DIR}/config-parser-trivial.c
53 ${BUS_DIR}/connection.c
54 ${BUS_DIR}/connection.h
55 ${BUS_DIR}/desktop-file.c
56 ${BUS_DIR}/desktop-file.h
57 ${BUS_DIR}/dir-watch.h
62 ${BUS_DIR}/expirelist.c
63 ${BUS_DIR}/expirelist.h
80 list(APPEND BUS_SOURCES
84 endif(DBUS_ENABLE_STATS)
88 ${CMAKE_SOURCE_DIR}/..
92 add_executable(dbus-daemon ${BUS_SOURCES} ${BUS_DIR}/main.c)
93 target_link_libraries(dbus-daemon ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY})
94 set_target_properties(dbus-daemon PROPERTIES OUTPUT_NAME ${DBUS_DAEMON_NAME})
95 set_target_properties(dbus-daemon PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
97 install(TARGETS dbus-daemon ${INSTALL_TARGETS_DEFAULT_ARGS})
98 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/session.conf DESTINATION share/dbus-1)
99 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/legacy-config/session.conf DESTINATION etc/dbus-1)
100 install(DIRECTORY DESTINATION share/dbus-1/session.d)
101 install(DIRECTORY DESTINATION share/dbus-1/services)
104 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/system.conf DESTINATION share/dbus-1)
105 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/legacy-config/system.conf DESTINATION etc/dbus-1)
106 install(DIRECTORY DESTINATION share/dbus-1/system.d)
107 install(DIRECTORY DESTINATION share/dbus-1/system-services)
108 install(DIRECTORY DESTINATION var/run/dbus)
112 set (dbus_service_SOURCES
113 ${BUS_DIR}/bus-service-win.c
114 # TODO: add additional files
115 # ${BUS_DIR}/service-main.c
119 add_executable(dbus-service ${dbus_service_SOURCES} )
120 target_link_libraries(dbus-service ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY})
121 set_target_properties(dbus-service PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
122 install(TARGETS dbus-service ${INSTALL_TARGETS_DEFAULT_ARGS})
125 set(LAUNCH_HELPER_SOURCES ${XML_SOURCES}
126 ${BUS_DIR}/config-parser-common.c
127 ${BUS_DIR}/config-parser-trivial.c
128 ${BUS_DIR}/desktop-file.c
130 ${BUS_DIR}/activation-helper.c
134 add_executable(dbus-daemon-launch-helper ${LAUNCH_HELPER_SOURCES} ${BUS_DIR}/activation-helper-bin.c )
135 target_link_libraries(dbus-daemon-launch-helper ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY} )
138 if (DBUS_ENABLE_EMBEDDED_TESTS)
139 set(SOURCES ${BUS_SOURCES} ${BUS_DIR}/test-main.c)
140 add_test_executable(test-bus "${SOURCES}" ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY})
141 set_target_properties(test-bus PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
143 set(test_bus_system_SOURCES
145 ${BUS_DIR}/config-parser-common.c
146 ${BUS_DIR}/config-parser-trivial.c
148 ${BUS_DIR}/test-system.c
150 add_test_executable(test-bus-system "${test_bus_system_SOURCES}" ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY} ${DBUS_BUS_LIBS})
152 add_executable(dbus-daemon-launch-helper-test ${LAUNCH_HELPER_SOURCES} ${BUS_DIR}/activation-helper-bin.c)
153 set_target_properties(dbus-daemon-launch-helper-test PROPERTIES COMPILE_FLAGS "-DACTIVATION_LAUNCHER_TEST")
154 target_link_libraries(dbus-daemon-launch-helper-test ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY} )
156 set (SOURCES ${LAUNCH_HELPER_SOURCES} ${BUS_DIR}/test-launch-helper.c)
157 add_test_executable(test-bus-launch-helper "${SOURCES}" ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY})
158 set_target_properties(test-bus-launch-helper PROPERTIES COMPILE_FLAGS "-DACTIVATION_LAUNCHER_TEST -DACTIVATION_LAUNCHER_DO_OOM")
159 install_targets(/lib dbus-daemon-launch-helper)
161 endif (DBUS_ENABLE_EMBEDDED_TESTS)
164 project_source_group(${GROUP_CODE} bus_test_SOURCES dummy)
167 ## mop up the gcov files
169 # /bin/rm *.bb *.bbg *.da *.gcov || true
172 # $(mkinstalldirs) $(DESTDIR)/$(localstatedir)/run/dbus
173 # $(mkinstalldirs) $(DESTDIR)/$(configdir)/system.d
174 # $(mkinstalldirs) $(DESTDIR)/$(datadir)/dbus-1/services
176 ##install_file(${configdir}/system.d FILE
178 #### Init scripts fun
179 #SCRIPT_IN_FILES=messagebus.in
183 #if DBUS_INIT_SCRIPTS_RED_HAT
185 #initddir=$(sysconfdir)/rc.d/init.d
194 #if DBUS_INIT_SCRIPTS_SLACKWARE
196 #initddir=$(sysconfdir)/rc.d/
204 #MAN_IN_FILES=dbus-daemon.1.in
205 #man_MANS = dbus-daemon.1
209 #EXTRA_DIST=$(CONFIG_IN_FILES) $(SCRIPT_IN_FILES) $(man_MANS) $(MAN_IN_FILES)