bus: Assign a serial number for messages from the driver
[platform/upstream/dbus.git] / cmake / tools / CMakeLists.txt
1 add_definitions("-DDBUS_COMPILATION")
2
3 set (dbus_send_SOURCES
4         ../../tools/dbus-print-message.c                        
5         ../../tools/dbus-print-message.h                        
6         ../../tools/dbus-send.c
7         ../../tools/tool-common.c
8         ../../tools/tool-common.h
9 )
10
11 set (dbus_monitor_SOURCES
12         ../../tools/dbus-monitor.c                              
13         ../../tools/dbus-print-message.c                        
14         ../../tools/dbus-print-message.h
15         ../../tools/tool-common.c
16         ../../tools/tool-common.h
17 )
18
19 set (dbus_test_tool_SOURCES
20         ../../tools/dbus-echo.c
21         ../../tools/dbus-spam.c
22         ../../tools/tool-common.c
23         ../../tools/tool-common.h
24         ../../tools/test-tool.c
25         ../../tools/test-tool.h
26 )
27
28 set (dbus_update_activation_environment_SOURCES
29         ../../tools/dbus-update-activation-environment.c
30         ../../tools/tool-common.c
31         ../../tools/tool-common.h
32 )
33
34 if (WIN32)
35 set (dbus_launch_SOURCES
36         ../../tools/dbus-launch-win.c
37 )
38 else (WIN32)
39 set (dbus_launch_SOURCES
40         ../../tools/dbus-launch.c
41         ../../tools/tool-common.c
42         ../../tools/tool-common.h
43 )
44 endif (WIN32)
45
46 if (DBUS_BUILD_X11)
47 set (dbus_launch_SOURCES
48      ${dbus_launch_SOURCES}
49      ../../tools/dbus-launch-x11.c
50 )
51 include_directories(${X11_INCLUDE_DIR})
52 endif(DBUS_BUILD_X11)
53
54 set (dbus_cleanup_sockets_SOURCES
55         ../../tools/dbus-cleanup-sockets.c
56 )
57
58 add_executable(dbus-send ${dbus_send_SOURCES})
59 target_link_libraries(dbus-send ${DBUS_LIBRARIES})
60 install(TARGETS dbus-send ${INSTALL_TARGETS_DEFAULT_ARGS})
61
62 add_executable(dbus-test-tool ${dbus_test_tool_SOURCES})
63 target_link_libraries(dbus-test-tool ${DBUS_LIBRARIES})
64 install(TARGETS dbus-test-tool ${INSTALL_TARGETS_DEFAULT_ARGS})
65
66 if(WIN32 AND NOT MSVC)
67     # avoid dbus-update-activation-environment triggering UAC
68     # 1 is the resource ID, ID_MANIFEST
69     # 24 is the resource type, RT_MANIFEST
70     # constants are used because of a bug in windres
71     # see https://stackoverflow.com/questions/33000158/embed-manifest-file-to-require-administrator-execution-level-with-mingw32
72     file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/disable-uac.rc "1 24 \"${CMAKE_SOURCE_DIR}/../tools/Win32.Manifest\"\n")
73     list(APPEND dbus_update_activation_environment_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/disable-uac.rc)
74 endif()
75 add_executable(dbus-update-activation-environment ${dbus_update_activation_environment_SOURCES})
76 target_link_libraries(dbus-update-activation-environment ${DBUS_LIBRARIES})
77 install(TARGETS dbus-update-activation-environment ${INSTALL_TARGETS_DEFAULT_ARGS})
78
79 add_executable(dbus-launch ${dbus_launch_SOURCES})
80 target_link_libraries(dbus-launch ${DBUS_LIBRARIES})
81 if (DBUS_BUILD_X11)
82   target_link_libraries(dbus-launch ${X11_LIBRARIES} )
83 endif (DBUS_BUILD_X11)
84 install(TARGETS dbus-launch ${INSTALL_TARGETS_DEFAULT_ARGS})
85
86 add_executable(dbus-monitor ${dbus_monitor_SOURCES})
87 target_link_libraries(dbus-monitor ${DBUS_LIBRARIES})
88 install(TARGETS dbus-monitor ${INSTALL_TARGETS_DEFAULT_ARGS})
89
90 # create the /var/lib/dbus directory for dbus-uuidgen
91 install(DIRECTORY DESTINATION var/lib/dbus)