@@ -5,6 +5,7 @@ set(BIN_NAME dde-clipboard)
5
5
project (${BIN_NAME} )
6
6
7
7
#set(CMAKE_VERBOSE_MAKEFILE ON)
8
+ set (QT_VERSION_MAJOR 6)
8
9
set (CMAKE_CXX_STANDARD 17)
9
10
set (CMAKE_INCLUDE_CURRENT_DIR ON )
10
11
set (CMAKE_AUTOMOC ON )
@@ -37,32 +38,20 @@ endif ()
37
38
38
39
# Find the library
39
40
find_package (PkgConfig REQUIRED)
40
- find_package (Dtk COMPONENTS Widget Core REQUIRED)
41
- find_package (Qt5 COMPONENTS Core Gui Widgets DBus Test Concurrent REQUIRED)
41
+ find_package (Dtk6 COMPONENTS Widget Core Tools REQUIRED)
42
+ find_package (Qt6 COMPONENTS Core Gui Widgets DBus WaylandClient Test Concurrent REQUIRED)
43
+ find_package (DDEShell REQUIRED)
42
44
find_package (DdeTrayLoader REQUIRED)
43
45
44
46
find_package (ECM REQUIRED NO_MODULE)
45
47
set (CMAKE_MODULE_PATH ${ECM_MODULE_PATH} )
46
- find_package (DWayland REQUIRED)
47
48
48
- pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-qt )
49
+ pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-qt6 )
49
50
50
51
if (NOT DEFINED SYSTEMD_USER_UNIT_DIR)
51
52
pkg_get_variable(SYSTEMD_USER_UNIT_DIR systemd systemduserunitdir)
52
53
endif ()
53
54
54
- find_package (DtkTools REQUIRED)
55
- function (generation_dbus_adaptor xml class_name class_file option)
56
- execute_process (COMMAND qdbusxml2cpp ${option} -a ${class_file} -c ${class_name} ${xml}
57
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} )
58
- endfunction (generation_dbus_adaptor)
59
-
60
- set (DBUS_INTERFACE ${PROJECT_SOURCE_DIR} /dbus/interface )
61
- function (generation_dbus_interface xml class_name class_file)
62
- execute_process (COMMAND ${DTK_XML2CPP} -c ${class_name} -p ${class_file} ${xml}
63
- WORKING_DIRECTORY ${DBUS_INTERFACE} )
64
- endfunction (generation_dbus_interface)
65
-
66
55
include_directories (
67
56
dde-clipboard
68
57
dde-clipboard/dbus
@@ -71,30 +60,11 @@ include_directories(
71
60
)
72
61
73
62
#----------------------------dde-clipboard------------------------------
74
- generation_dbus_adaptor(
75
- ${CMAKE_SOURCE_DIR} /dde-clipboard/org.deepin.dde.Clipboard1.xml
76
- ClipboardAdaptor
77
- ${CMAKE_CURRENT_BINARY_DIR} /clipboard_adaptor
78
- -N
79
- )
80
63
81
- generation_dbus_interface(
82
- ${CMAKE_SOURCE_DIR} /dbus/org.deepin.dde.Display1.Monitor.xml
83
- Monitor
84
- ${DBUS_INTERFACE} /monitor_interface
85
- )
86
-
87
- generation_dbus_interface(
88
- ${CMAKE_SOURCE_DIR} /dbus/org.deepin.dde.Display1.xml
89
- Display1
90
- ${DBUS_INTERFACE} /display_interface
91
- )
92
-
93
- generation_dbus_interface(
94
- ${CMAKE_SOURCE_DIR} /dbus/org.deepin.dde.daemon.Dock1.xml
95
- Dock1
96
- ${DBUS_INTERFACE} /dock_interface
97
- )
64
+ qt_add_dbus_adaptor(DBUS_INTERFACES ${CMAKE_SOURCE_DIR} /dde-clipboard/org.deepin.dde.Clipboard1.xml mainwindow.h MainWindow)
65
+ dtk_add_dbus_interface(DBUS_INTERFACES ${CMAKE_SOURCE_DIR} /dbus/org.deepin.dde.Display1.Monitor.xml Monitor)
66
+ dtk_add_dbus_interface(DBUS_INTERFACES ${CMAKE_SOURCE_DIR} /dbus/org.deepin.dde.Display1.xml Display1)
67
+ dtk_add_dbus_interface(DBUS_INTERFACES ${CMAKE_SOURCE_DIR} /dbus/org.deepin.dde.daemon.Dock1.xml Dock1)
98
68
99
69
include_directories (
100
70
${PROJECT_SOURCE_DIR} /dbus/interface
@@ -103,12 +73,6 @@ include_directories(
103
73
)
104
74
105
75
aux_source_directory (dbus/types DBUS_TYPES)
106
- aux_source_directory (dbus/interface DBUS_INTERFACES)
107
-
108
- set (Clipboard_DBUS_SCRS
109
- ${CMAKE_CURRENT_BINARY_DIR} /clipboard_adaptor.h
110
- ${CMAKE_CURRENT_BINARY_DIR} /clipboard_adaptor.cpp
111
- )
112
76
113
77
file (GLOB_RECURSE Clipboard_SCRS
114
78
"dde-clipboard/*.h"
@@ -125,14 +89,15 @@ add_executable(${BIN_NAME}
125
89
)
126
90
127
91
target_link_libraries (${BIN_NAME} PRIVATE
128
- Dtk ::Widget
129
- Dtk ::Core
92
+ Dtk6 ::Widget
93
+ Dtk6 ::Core
130
94
PkgConfig::GIO
131
- Qt5::Core
132
- Qt5::Widgets
133
- Qt5::GuiPrivate
134
- Qt5::Gui
135
- Qt5::DBus
95
+ Qt6::Core
96
+ Qt6::Widgets
97
+ Qt6::GuiPrivate
98
+ Qt6::Gui
99
+ Qt6::DBus
100
+ Dde::Shell
136
101
)
137
102
138
103
macro (install_symlink filepath wantsdir)
@@ -179,13 +144,16 @@ add_executable(${BIN_NAME}
179
144
${dde-clipboard-daemon_SCRS}
180
145
)
181
146
147
+ qt_generate_wayland_protocol_client_sources(${BIN_NAME} FILES
148
+ ${CMAKE_CURRENT_SOURCE_DIR} /dde-clipboard-daemon/protocol/wlr-data-control-unstable-v1.xml)
149
+
182
150
target_link_libraries (${BIN_NAME} PRIVATE
183
- Qt5 ::Gui
184
- Qt5 ::DBus
185
- Qt5::Widgets
186
- Dtk::Core
187
- Qt5::Concurrent
188
- DWaylandClient
151
+ Qt6 ::Gui
152
+ Qt6 ::DBus
153
+ Qt6::Concurrent
154
+ Qt6::WaylandClient
155
+ Qt6::WaylandClientPrivate
156
+ Dtk6::Core
189
157
)
190
158
191
159
install (TARGETS ${BIN_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} )
@@ -236,13 +204,14 @@ add_executable(${UT_BIN_NAME}
236
204
target_compile_options (${UT_BIN_NAME} PRIVATE -fprofile-arcs -ftest-coverage)
237
205
238
206
target_link_libraries (${UT_BIN_NAME} PRIVATE
239
- Dtk ::Widget
207
+ Dtk6 ::Widget
240
208
PkgConfig::GIO
241
- Qt5::Core
242
- Qt5::Widgets
243
- Qt5::DBus
244
- Qt5::Test
245
- Qt5::GuiPrivate
209
+ Qt6::Core
210
+ Qt6::Widgets
211
+ Qt6::DBus
212
+ Qt6::Test
213
+ Qt6::GuiPrivate
214
+ Dde::Shell
246
215
-lpthread
247
216
-lgcov
248
217
-lgtest
0 commit comments