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 FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/session.d)
11 CONFIGURE_FILE( "system.conf.cmake" "${CMAKE_CURRENT_BINARY_DIR}/system.conf" IMMEDIATE @ONLY)
12 FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/system.d)
15 # copy services for local daemon start to local service dir data/dbus-1/services
16 SET (SERVICE_FILES test/data/valid-service-files)
17 FILE(GLOB FILES "${CMAKE_SOURCE_DIR}/../${SERVICE_FILES}/*.service.in" )
18 FOREACH(FILE ${FILES})
19 GET_FILENAME_COMPONENT(FILENAME ${FILE} NAME_WE)
20 SET (TARGET ${CMAKE_BINARY_DIR}/data/dbus-1/services/${FILENAME}.service)
22 MESSAGE("FROM: ${FILE}\nTO: ${TARGET}\n")
23 ENDIF (CONFIG_VERBOSE)
24 configure_file(${FILE} ${TARGET} )
27 SET (XML_SOURCES ${BUS_DIR}/config-loader-expat.c)
29 if (DBUS_BUS_ENABLE_INOTIFY)
30 set (DIR_WATCH_SOURCE ${BUS_DIR}/dir-watch-inotify.c)
31 elseif (DBUS_BUS_ENABLE_KQUEUE)
32 set (DIR_WATCH_SOURCE ${BUS_DIR}/dir-watch-kqueue.c)
33 else (DBUS_BUS_ENABLE_INOTIFY)
34 set (DIR_WATCH_SOURCE ${BUS_DIR}/dir-watch-default.c)
35 endif (DBUS_BUS_ENABLE_INOTIFY)
38 ${BUS_DIR}/activation.c
39 ${BUS_DIR}/activation.h
42 ${BUS_DIR}/config-parser.c
43 ${BUS_DIR}/config-parser.h
44 ${BUS_DIR}/config-parser-common.c
45 ${BUS_DIR}/config-parser-common.h
46 # ${BUS_DIR}/config-parser-trivial.c
47 ${BUS_DIR}/connection.c
48 ${BUS_DIR}/connection.h
49 ${BUS_DIR}/desktop-file.c
50 ${BUS_DIR}/desktop-file.h
51 ${BUS_DIR}/dir-watch.h
56 ${BUS_DIR}/expirelist.c
57 ${BUS_DIR}/expirelist.h
74 list(APPEND BUS_SOURCES
78 endif(DBUS_ENABLE_STATS)
82 ${CMAKE_SOURCE_DIR}/..
86 add_executable(dbus-daemon ${BUS_SOURCES} ${BUS_DIR}/main.c)
87 target_link_libraries(dbus-daemon ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY})
88 set_target_properties(dbus-daemon PROPERTIES OUTPUT_NAME ${DBUS_DAEMON_NAME})
89 set_target_properties(dbus-daemon PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
91 install_targets(/bin dbus-daemon)
92 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/session.conf DESTINATION etc/dbus-1)
93 install(DIRECTORY DESTINATION etc/dbus-1/session.d)
94 install(DIRECTORY DESTINATION share/dbus-1/services)
97 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/system.conf DESTINATION etc/dbus-1)
98 install(DIRECTORY DESTINATION etc/dbus-1/system.d)
99 install(DIRECTORY DESTINATION share/dbus-1/system-services)
100 install(DIRECTORY DESTINATION var/run/dbus)
104 set (dbus_service_SOURCES
105 ${BUS_DIR}/bus-service-win.c
106 # TODO: add additional files
107 # ${BUS_DIR}/service-main.c
111 add_executable(dbus-service ${dbus_service_SOURCES} )
112 target_link_libraries(dbus-service ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY})
113 set_target_properties(dbus-service PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
114 install_targets(/bin dbus-service )
117 if (DBUS_ENABLE_EMBEDDED_TESTS)
118 set(SOURCES ${BUS_SOURCES} ${BUS_DIR}/test-main.c)
119 add_test_executable(test-bus "${SOURCES}" ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY})
120 set_target_properties(test-bus PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
122 set(test_bus_system_SOURCES
124 ${BUS_DIR}/config-parser-common.c
125 ${BUS_DIR}/config-parser-trivial.c
127 ${BUS_DIR}/test-system.c
129 add_test_executable(test-bus-system "${test_bus_system_SOURCES}" ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY} ${DBUS_BUS_LIBS})
131 endif (DBUS_ENABLE_EMBEDDED_TESTS)
134 project_source_group(${GROUP_CODE} bus_test_SOURCES dummy)
137 ## mop up the gcov files
139 # /bin/rm *.bb *.bbg *.da *.gcov || true
142 # $(mkinstalldirs) $(DESTDIR)/$(localstatedir)/run/dbus
143 # $(mkinstalldirs) $(DESTDIR)/$(configdir)/system.d
144 # $(mkinstalldirs) $(DESTDIR)/$(datadir)/dbus-1/services
146 ##install_file(${configdir}/system.d FILE
149 set(LAUNCH_HELPER_SOURCES ${XML_SOURCES}
150 ${BUS_DIR}/config-parser-common.c
151 ${BUS_DIR}/config-parser-trivial.c
152 ${BUS_DIR}/desktop-file.c
154 ${BUS_DIR}/activation-helper.c
159 # TODO PENDING(kdab) fix build on windows (activation-helper.c)
160 add_executable(dbus-daemon-launch-helper ${LAUNCH_HELPER_SOURCES} ${BUS_DIR}/activation-helper-bin.c )
161 target_link_libraries(dbus-daemon-launch-helper ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY} )
163 add_executable(dbus-daemon-launch-helper-test ${LAUNCH_HELPER_SOURCES} ${BUS_DIR}/activation-helper-bin.c)
164 set_target_properties(dbus-daemon-launch-helper-test PROPERTIES COMPILE_FLAGS "-DACTIVATION_LAUNCHER_TEST")
165 target_link_libraries(dbus-daemon-launch-helper-test ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY} )
167 set (SOURCES ${LAUNCH_HELPER_SOURCES} ${BUS_DIR}/test-launch-helper.c)
168 add_test_executable(test-bus-launch-helper "${SOURCES}" ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY})
169 set_target_properties(test-bus-launch-helper PROPERTIES COMPILE_FLAGS "-DACTIVATION_LAUNCHER_TEST -DACTIVATION_LAUNCHER_DO_OOM")
172 #### Init scripts fun
173 #SCRIPT_IN_FILES=messagebus.in
177 #if DBUS_INIT_SCRIPTS_RED_HAT
179 #initddir=$(sysconfdir)/rc.d/init.d
188 #if DBUS_INIT_SCRIPTS_SLACKWARE
190 #initddir=$(sysconfdir)/rc.d/
198 #MAN_IN_FILES=dbus-daemon.1.in
199 #man_MANS = dbus-daemon.1
203 #EXTRA_DIST=$(CONFIG_IN_FILES) $(SCRIPT_IN_FILES) $(man_MANS) $(MAN_IN_FILES)