v30.3-roots.1 · Commit 5: [PATCH 05/68] feat(qt): preserve Roots identity and GUI support on Core 30.3
src/qt/CMakeLists.txt
Before: src/qt/CMakeLists.txt · After: src/qt/CMakeLists.txt
File metadata
index c23a7ec6d54b7bd9ab165d29955fa97bd910c660..2bf931d191d0bf7f10f7e46e36f54edad8f51253 100644
Download original patch · Release notes
Diff rows 1–177 of 177. Line numbers refer to the original before/after files.
+ Added− RemovedUnmarked lines are context.
Scroll the code area horizontally to read long lines. The two line-number columns refer to before and after.
src/qt/CMakeLists.txt
CHANGED
|
@@ -11,19 +11,24 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
|
|
11
11
|
string(APPEND CMAKE_OBJCXX_COMPILE_OBJECT " ${APPEND_CPPFLAGS} ${APPEND_CXXFLAGS}")
|
|
12
12
|
endif()
|
|
13
13
|
|
|
14
|
-
get_target_property(qt_lib_type Qt6::Core TYPE)
|
|
14
|
+
get_target_property(qt_lib_type Qt${WITH_QT_VERSION}::Core TYPE)
|
|
15
15
|
|
|
16
16
|
function(import_plugins target)
|
|
17
17
|
if(qt_lib_type STREQUAL "STATIC_LIBRARY")
|
|
18
|
-
set(plugins Qt6::QMinimalIntegrationPlugin)
|
|
18
|
+
set(plugins Qt${WITH_QT_VERSION}::QMinimalIntegrationPlugin)
|
|
19
19
|
if(CMAKE_SYSTEM_NAME MATCHES "^(Linux|FreeBSD)$")
|
|
20
|
-
list(APPEND plugins Qt6::QXcbIntegrationPlugin)
|
|
20
|
+
list(APPEND plugins Qt${WITH_QT_VERSION}::QXcbIntegrationPlugin)
|
|
21
21
|
elseif(WIN32)
|
|
22
|
-
list(APPEND plugins Qt6::QWindowsIntegrationPlugin Qt6::QModernWindowsStylePlugin)
|
|
22
|
+
list(APPEND plugins Qt${WITH_QT_VERSION}::QWindowsIntegrationPlugin)
|
|
23
|
+
if(WITH_QT_VERSION STREQUAL "6")
|
|
24
|
+
list(APPEND plugins Qt6::QModernWindowsStylePlugin)
|
|
25
|
+
else()
|
|
26
|
+
list(APPEND plugins Qt5::QWindowsVistaStylePlugin)
|
|
27
|
+
endif()
|
|
23
28
|
elseif(APPLE)
|
|
24
|
-
list(APPEND plugins Qt6::QCocoaIntegrationPlugin Qt6::QMacStylePlugin)
|
|
29
|
+
list(APPEND plugins Qt${WITH_QT_VERSION}::QCocoaIntegrationPlugin Qt${WITH_QT_VERSION}::QMacStylePlugin)
|
|
25
30
|
endif()
|
|
26
|
-
qt6_import_plugins(${target}
|
|
31
|
+
cmake_language(CALL "qt${WITH_QT_VERSION}_import_plugins" ${target}
|
|
27
32
|
INCLUDE ${plugins}
|
|
28
33
|
EXCLUDE_BY_TYPE
|
|
29
34
|
accessiblebridge
|
|
@@ -54,7 +59,67 @@ set(CMAKE_AUTORCC ON)
|
|
|
54
59
|
set(CMAKE_AUTOUIC ON)
|
|
55
60
|
set(CMAKE_AUTOUIC_SEARCH_PATHS forms)
|
|
56
61
|
|
|
62
|
+
set(ICON_PATH "res/rendered_icons")
|
|
63
|
+
set(ICO_SPECS
|
|
64
|
+
256 64 48 32 24 20 16
|
|
65
|
+
)
|
|
66
|
+
set(ICNS_SPECS
|
|
67
|
+
1024
|
|
68
|
+
)
|
|
69
|
+
set(bitcoin_svg "res/src/bitcoinroots-logo.svg")
|
|
70
|
+
|
|
71
|
+
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${ICON_PATH}")
|
|
72
|
+
foreach(size IN LISTS ICO_SPECS ICNS_SPECS)
|
|
73
|
+
set(png "${ICON_PATH}/bitcoin${size}.png")
|
|
74
|
+
add_custom_command(
|
|
75
|
+
OUTPUT "${png}"
|
|
76
|
+
COMMAND "${RSVG_CONVERT}" -f png -d ${size} -p ${size} --output "${png}" "${CMAKE_CURRENT_SOURCE_DIR}/${bitcoin_svg}"
|
|
77
|
+
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${bitcoin_svg}"
|
|
78
|
+
COMMENT "Generating ${png} from ${bitcoin_svg}"
|
|
79
|
+
VERBATIM
|
|
80
|
+
)
|
|
81
|
+
endforeach()
|
|
82
|
+
|
|
83
|
+
set(bitcoin_icns "${ICON_PATH}/bitcoin.icns")
|
|
84
|
+
add_custom_command(
|
|
85
|
+
OUTPUT "${bitcoin_icns}"
|
|
86
|
+
COMMAND "${PNG2ICNS}" "${bitcoin_icns}" "${ICON_PATH}/bitcoin1024.png"
|
|
87
|
+
DEPENDS "${ICON_PATH}/bitcoin1024.png"
|
|
88
|
+
COMMENT "Generating ${bitcoin_icns} from the Roots icon"
|
|
89
|
+
VERBATIM
|
|
90
|
+
)
|
|
91
|
+
add_custom_target(generate_icns DEPENDS "${bitcoin_icns}")
|
|
92
|
+
|
|
93
|
+
set(bitcoin_ico "${ICON_PATH}/bitcoin.ico")
|
|
94
|
+
set(testnet_ico "${ICON_PATH}/bitcoin_testnet.ico")
|
|
95
|
+
add_custom_command(
|
|
96
|
+
OUTPUT "${bitcoin_ico}"
|
|
97
|
+
COMMAND "${IMAGEMAGICK_CONVERT}" ${ICON_PATH}/bitcoin256.png ${ICON_PATH}/bitcoin64.png ${ICON_PATH}/bitcoin48.png ${ICON_PATH}/bitcoin32.png ${ICON_PATH}/bitcoin24.png ${ICON_PATH}/bitcoin20.png ${ICON_PATH}/bitcoin16.png "${bitcoin_ico}"
|
|
98
|
+
DEPENDS ${ICON_PATH}/bitcoin256.png ${ICON_PATH}/bitcoin64.png ${ICON_PATH}/bitcoin48.png ${ICON_PATH}/bitcoin32.png ${ICON_PATH}/bitcoin24.png ${ICON_PATH}/bitcoin20.png ${ICON_PATH}/bitcoin16.png
|
|
99
|
+
COMMENT "Generating ${bitcoin_ico} from Roots icon sizes"
|
|
100
|
+
VERBATIM
|
|
101
|
+
)
|
|
102
|
+
add_custom_command(
|
|
103
|
+
OUTPUT "${testnet_ico}"
|
|
104
|
+
COMMAND "${IMAGEMAGICK_CONVERT}" "${bitcoin_ico}" -modulate 100,100,138.9 -colorspace HSL -channel G -evaluate subtract "11.76%" +channel -colorspace sRGB "${testnet_ico}"
|
|
105
|
+
DEPENDS "${bitcoin_ico}"
|
|
106
|
+
COMMENT "Generating ${testnet_ico} from ${bitcoin_ico}"
|
|
107
|
+
VERBATIM
|
|
108
|
+
)
|
|
109
|
+
add_custom_target(generate_ico DEPENDS "${bitcoin_ico}" "${testnet_ico}")
|
|
110
|
+
|
|
111
|
+
set(roots_logo_png "${ICON_PATH}/bitcoinroots-logo.png")
|
|
112
|
+
add_custom_command(
|
|
113
|
+
OUTPUT "${roots_logo_png}"
|
|
114
|
+
COMMAND "${RSVG_CONVERT}" -f png -d 960 -p 960 --output "${roots_logo_png}" "${CMAKE_CURRENT_SOURCE_DIR}/${bitcoin_svg}"
|
|
115
|
+
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${bitcoin_svg}"
|
|
116
|
+
COMMENT "Generating ${roots_logo_png} from ${bitcoin_svg}"
|
|
117
|
+
VERBATIM
|
|
118
|
+
)
|
|
119
|
+
add_custom_target(generate_roots_splash DEPENDS "${roots_logo_png}")
|
|
120
|
+
|
|
57
121
|
configure_file(bitcoin_locale.qrc bitcoin_locale.qrc USE_SOURCE_PERMISSIONS COPYONLY)
|
|
122
|
+
configure_file(bitcoin_rendered.qrc bitcoin_rendered.qrc USE_SOURCE_PERMISSIONS COPYONLY)
|
|
58
123
|
|
|
59
124
|
# The bitcoinqt sources have to include headers in
|
|
60
125
|
# order to parse them to collect translatable strings.
|
|
@@ -121,6 +186,7 @@ add_library(bitcoinqt STATIC EXCLUDE_FROM_ALL
|
|
|
121
186
|
$<$<PLATFORM_ID:Windows>:winshutdownmonitor.h>
|
|
122
187
|
bitcoin.qrc
|
|
123
188
|
${CMAKE_CURRENT_BINARY_DIR}/bitcoin_locale.qrc
|
|
189
|
+
${CMAKE_CURRENT_BINARY_DIR}/bitcoin_rendered.qrc
|
|
124
190
|
)
|
|
125
191
|
target_compile_definitions(bitcoinqt
|
|
126
192
|
PUBLIC
|
|
@@ -137,7 +203,7 @@ set_property(SOURCE macnotificationhandler.mm
|
|
|
137
203
|
)
|
|
138
204
|
target_link_libraries(bitcoinqt
|
|
139
205
|
PUBLIC
|
|
140
|
-
Qt6::Widgets
|
|
206
|
+
Qt${WITH_QT_VERSION}::Widgets
|
|
141
207
|
PRIVATE
|
|
142
208
|
core_interface
|
|
143
209
|
bitcoin_cli
|
|
@@ -147,6 +213,7 @@ target_link_libraries(bitcoinqt
|
|
|
147
213
|
$<$<PLATFORM_ID:Darwin>:-framework\ AppKit>
|
|
148
214
|
$<$<CXX_COMPILER_ID:MSVC>:shlwapi>
|
|
149
215
|
)
|
|
216
|
+
add_dependencies(bitcoinqt generate_roots_splash)
|
|
150
217
|
|
|
151
218
|
if(ENABLE_WALLET)
|
|
152
219
|
target_sources(bitcoinqt
|
|
@@ -215,18 +282,30 @@ if(ENABLE_WALLET)
|
|
|
215
282
|
target_link_libraries(bitcoinqt
|
|
216
283
|
PRIVATE
|
|
217
284
|
bitcoin_wallet
|
|
218
|
-
Qt6::Network
|
|
285
|
+
Qt${WITH_QT_VERSION}::Network
|
|
219
286
|
)
|
|
220
287
|
endif()
|
|
221
288
|
|
|
222
289
|
if(WITH_DBUS)
|
|
223
|
-
target_link_libraries(bitcoinqt PRIVATE Qt6::DBus)
|
|
290
|
+
target_link_libraries(bitcoinqt PRIVATE Qt${WITH_QT_VERSION}::DBus)
|
|
291
|
+
endif()
|
|
292
|
+
|
|
293
|
+
if(WITH_TASKBAR_PROGRESS)
|
|
294
|
+
target_sources(bitcoinqt
|
|
295
|
+
PRIVATE
|
|
296
|
+
$<$<PLATFORM_ID:Windows>:wintaskbarprogress.cpp>
|
|
297
|
+
$<$<PLATFORM_ID:Windows>:wintaskbarprogress.h>
|
|
298
|
+
)
|
|
299
|
+
target_link_libraries(bitcoinqt
|
|
300
|
+
PRIVATE
|
|
301
|
+
$<$<PLATFORM_ID:Windows>:ole32>
|
|
302
|
+
)
|
|
224
303
|
endif()
|
|
225
304
|
|
|
226
305
|
if(qt_lib_type STREQUAL "STATIC_LIBRARY")
|
|
227
306
|
# We want to define static plugins to link ourselves, thus preventing
|
|
228
307
|
# automatic linking against a "sane" set of default static plugins.
|
|
229
|
-
qt6_import_plugins(bitcoinqt
|
|
308
|
+
cmake_language(CALL "qt${WITH_QT_VERSION}_import_plugins" bitcoinqt
|
|
230
309
|
EXCLUDE_BY_TYPE
|
|
231
310
|
accessiblebridge
|
|
232
311
|
platforms
|
|
@@ -252,7 +331,14 @@ add_executable(bitcoin-qt
|
|
|
252
331
|
../init/bitcoin-qt.cpp
|
|
253
332
|
)
|
|
254
333
|
|
|
255
|
-
add_windows_resources(bitcoin-qt res/bitcoin-qt-res.rc)
|
|
334
|
+
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
|
335
|
+
add_dependencies(bitcoin-qt generate_ico)
|
|
336
|
+
endif()
|
|
337
|
+
|
|
338
|
+
if(WIN32)
|
|
339
|
+
configure_file(res/bitcoin-qt-res.rc res/bitcoin-qt-res.rc USE_SOURCE_PERMISSIONS @ONLY)
|
|
340
|
+
add_windows_resources(bitcoin-qt ${CMAKE_CURRENT_BINARY_DIR}/res/bitcoin-qt-res.rc)
|
|
341
|
+
endif()
|
|
256
342
|
add_windows_application_manifest(bitcoin-qt)
|
|
257
343
|
|
|
258
344
|
target_link_libraries(bitcoin-qt
|
|
@@ -298,8 +384,8 @@ else()
|
|
|
298
384
|
add_custom_target(translate COMMAND ${CMAKE_COMMAND}
|
|
299
385
|
-D "PROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}"
|
|
300
386
|
-D "COPYRIGHT_HOLDERS=${COPYRIGHT_HOLDERS}"
|
|
301
|
-
-D "LCONVERT_EXECUTABLE=$<TARGET_FILE:Qt6::lconvert>"
|
|
302
|
-
-D "LUPDATE_EXECUTABLE=$<TARGET_FILE:Qt6::lupdate>"
|
|
387
|
+
-D "LCONVERT_EXECUTABLE=$<TARGET_FILE:Qt${WITH_QT_VERSION}::lconvert>"
|
|
388
|
+
-D "LUPDATE_EXECUTABLE=$<TARGET_FILE:Qt${WITH_QT_VERSION}::lupdate>"
|
|
303
389
|
-D "XGETTEXT_EXECUTABLE=${XGETTEXT_EXECUTABLE}"
|
|
304
390
|
-P ${PROJECT_SOURCE_DIR}/share/qt/translate.cmake
|
|
305
391
|
)
|