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
44 ${BUS_DIR}/config-parser.c
45 ${BUS_DIR}/config-parser.h
46 ${BUS_DIR}/config-parser-common.c
47 ${BUS_DIR}/config-parser-common.h
48 # ${BUS_DIR}/config-parser-trivial.c
49 ${BUS_DIR}/connection.c
50 ${BUS_DIR}/connection.h
51 ${BUS_DIR}/desktop-file.c
52 ${BUS_DIR}/desktop-file.h
53 ${BUS_DIR}/dir-watch.h
58 ${BUS_DIR}/expirelist.c
59 ${BUS_DIR}/expirelist.h
76 list(APPEND BUS_SOURCES
80 endif(DBUS_ENABLE_STATS)
84 ${CMAKE_SOURCE_DIR}/..
88 add_executable(dbus-daemon ${BUS_SOURCES} ${BUS_DIR}/main.c)
89 target_link_libraries(dbus-daemon ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY})
90 set_target_properties(dbus-daemon PROPERTIES OUTPUT_NAME ${DBUS_DAEMON_NAME})
91 set_target_properties(dbus-daemon PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
93 install_targets(/bin dbus-daemon)
94 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/session.conf DESTINATION etc/dbus-1)
95 install(DIRECTORY DESTINATION etc/dbus-1/session.d)
96 install(DIRECTORY DESTINATION share/dbus-1/services)
99 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/system.conf DESTINATION etc/dbus-1)
100 install(DIRECTORY DESTINATION etc/dbus-1/system.d)
101 install(DIRECTORY DESTINATION share/dbus-1/system-services)
102 install(DIRECTORY DESTINATION var/run/dbus)
106 set (dbus_service_SOURCES
107 ${BUS_DIR}/bus-service-win.c
108 # TODO: add additional files
109 # ${BUS_DIR}/service-main.c
113 add_executable(dbus-service ${dbus_service_SOURCES} )
114 target_link_libraries(dbus-service ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY})
115 set_target_properties(dbus-service PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
116 install_targets(/bin dbus-service )
119 if (DBUS_ENABLE_EMBEDDED_TESTS)
120 set(SOURCES ${BUS_SOURCES} ${BUS_DIR}/test-main.c)
121 add_test_executable(test-bus "${SOURCES}" ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY})
122 set_target_properties(test-bus PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_CLIENT_DEFINITIONS})
124 set(test_bus_system_SOURCES
126 ${BUS_DIR}/config-parser-common.c
127 ${BUS_DIR}/config-parser-trivial.c
129 ${BUS_DIR}/test-system.c
131 add_test_executable(test-bus-system "${test_bus_system_SOURCES}" ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY} ${DBUS_BUS_LIBS})
133 endif (DBUS_ENABLE_EMBEDDED_TESTS)
136 project_source_group(${GROUP_CODE} bus_test_SOURCES dummy)
139 ## mop up the gcov files
141 # /bin/rm *.bb *.bbg *.da *.gcov || true
144 # $(mkinstalldirs) $(DESTDIR)/$(localstatedir)/run/dbus
145 # $(mkinstalldirs) $(DESTDIR)/$(configdir)/system.d
146 # $(mkinstalldirs) $(DESTDIR)/$(datadir)/dbus-1/services
148 ##install_file(${configdir}/system.d FILE
151 set(LAUNCH_HELPER_SOURCES ${XML_SOURCES}
152 ${BUS_DIR}/config-parser-common.c
153 ${BUS_DIR}/config-parser-trivial.c
154 ${BUS_DIR}/desktop-file.c
156 ${BUS_DIR}/activation-helper.c
161 # TODO PENDING(kdab) fix build on windows (activation-helper.c)
162 add_executable(dbus-daemon-launch-helper ${LAUNCH_HELPER_SOURCES} ${BUS_DIR}/activation-helper-bin.c )
163 target_link_libraries(dbus-daemon-launch-helper ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY} )
165 add_executable(dbus-daemon-launch-helper-test ${LAUNCH_HELPER_SOURCES} ${BUS_DIR}/activation-helper-bin.c)
166 set_target_properties(dbus-daemon-launch-helper-test PROPERTIES COMPILE_FLAGS "-DACTIVATION_LAUNCHER_TEST")
167 target_link_libraries(dbus-daemon-launch-helper-test ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY} )
169 set (SOURCES ${LAUNCH_HELPER_SOURCES} ${BUS_DIR}/test-launch-helper.c)
170 add_test_executable(test-bus-launch-helper "${SOURCES}" ${DBUS_INTERNAL_LIBRARIES} ${XML_LIBRARY})
171 set_target_properties(test-bus-launch-helper PROPERTIES COMPILE_FLAGS "-DACTIVATION_LAUNCHER_TEST -DACTIVATION_LAUNCHER_DO_OOM")
174 #### Init scripts fun
175 #SCRIPT_IN_FILES=messagebus.in
179 #if DBUS_INIT_SCRIPTS_RED_HAT
181 #initddir=$(sysconfdir)/rc.d/init.d
190 #if DBUS_INIT_SCRIPTS_SLACKWARE
192 #initddir=$(sysconfdir)/rc.d/
200 #MAN_IN_FILES=dbus-daemon.1.in
201 #man_MANS = dbus-daemon.1
205 #EXTRA_DIST=$(CONFIG_IN_FILES) $(SCRIPT_IN_FILES) $(man_MANS) $(MAN_IN_FILES)