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. Before is on the left; after is on the right. Unified view fits narrow screens more easily.
src/qt/CMakeLists.txt
CHANGED
|
@@ -11,19 +11,24 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
|
| 11 |
string(APPEND CMAKE_OBJCXX_COMPILE_OBJECT " ${APPEND_CPPFLAGS} ${APPEND_CXXFLAGS}")
|
| 12 |
endif()
|
| 13 |
|
| 14 |
-
get_target_property(qt_lib_type Qt6::Core TYPE)
|
| 15 |
|
| 16 |
function(import_plugins target)
|
| 17 |
if(qt_lib_type STREQUAL "STATIC_LIBRARY")
|
| 18 |
-
set(plugins Qt6::QMinimalIntegrationPlugin)
|
| 19 |
if(CMAKE_SYSTEM_NAME MATCHES "^(Linux|FreeBSD)$")
|
| 20 |
-
list(APPEND plugins Qt6::QXcbIntegrationPlugin)
|
| 21 |
elseif(WIN32)
|
| 22 |
-
list(APPEND plugins Qt6::QWindowsIntegrationPlugin Qt6::QModernWindowsStylePlugin)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
elseif(APPLE)
|
| 24 |
-
list(APPEND plugins Qt6::QCocoaIntegrationPlugin Qt6::QMacStylePlugin)
|
| 25 |
endif()
|
| 26 |
-
qt6_import_plugins(${target}
|
| 27 |
INCLUDE ${plugins}
|
| 28 |
EXCLUDE_BY_TYPE
|
| 29 |
accessiblebridge
|
|
@@ -54,7 +59,67 @@ set(CMAKE_AUTORCC ON)
|
|
| 54 |
set(CMAKE_AUTOUIC ON)
|
| 55 |
set(CMAKE_AUTOUIC_SEARCH_PATHS forms)
|
| 56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
configure_file(bitcoin_locale.qrc bitcoin_locale.qrc USE_SOURCE_PERMISSIONS COPYONLY)
|
|
|
|
| 58 |
|
| 59 |
# The bitcoinqt sources have to include headers in
|
| 60 |
# order to parse them to collect translatable strings.
|
|
@@ -121,6 +186,7 @@ add_library(bitcoinqt STATIC EXCLUDE_FROM_ALL
|
|
| 121 |
$<$<PLATFORM_ID:Windows>:winshutdownmonitor.h>
|
| 122 |
bitcoin.qrc
|
| 123 |
${CMAKE_CURRENT_BINARY_DIR}/bitcoin_locale.qrc
|
|
|
|
| 124 |
)
|
| 125 |
target_compile_definitions(bitcoinqt
|
| 126 |
PUBLIC
|
|
@@ -137,7 +203,7 @@ set_property(SOURCE macnotificationhandler.mm
|
|
| 137 |
)
|
| 138 |
target_link_libraries(bitcoinqt
|
| 139 |
PUBLIC
|
| 140 |
-
Qt6::Widgets
|
| 141 |
PRIVATE
|
| 142 |
core_interface
|
| 143 |
bitcoin_cli
|
|
@@ -147,6 +213,7 @@ target_link_libraries(bitcoinqt
|
|
| 147 |
$<$<PLATFORM_ID:Darwin>:-framework\ AppKit>
|
| 148 |
$<$<CXX_COMPILER_ID:MSVC>:shlwapi>
|
| 149 |
)
|
|
|
|
| 150 |
|
| 151 |
if(ENABLE_WALLET)
|
| 152 |
target_sources(bitcoinqt
|
|
@@ -215,18 +282,30 @@ if(ENABLE_WALLET)
|
|
| 215 |
target_link_libraries(bitcoinqt
|
| 216 |
PRIVATE
|
| 217 |
bitcoin_wallet
|
| 218 |
-
Qt6::Network
|
| 219 |
)
|
| 220 |
endif()
|
| 221 |
|
| 222 |
if(WITH_DBUS)
|
| 223 |
-
target_link_libraries(bitcoinqt PRIVATE Qt6::DBus)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 224 |
endif()
|
| 225 |
|
| 226 |
if(qt_lib_type STREQUAL "STATIC_LIBRARY")
|
| 227 |
# We want to define static plugins to link ourselves, thus preventing
|
| 228 |
# automatic linking against a "sane" set of default static plugins.
|
| 229 |
-
qt6_import_plugins(bitcoinqt
|
| 230 |
EXCLUDE_BY_TYPE
|
| 231 |
accessiblebridge
|
| 232 |
platforms
|
|
@@ -252,7 +331,14 @@ add_executable(bitcoin-qt
|
|
| 252 |
../init/bitcoin-qt.cpp
|
| 253 |
)
|
| 254 |
|
| 255 |
-
add_windows_resources(bitcoin-qt res/bitcoin-qt-res.rc)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 256 |
add_windows_application_manifest(bitcoin-qt)
|
| 257 |
|
| 258 |
target_link_libraries(bitcoin-qt
|
|
@@ -298,8 +384,8 @@ else()
|
|
| 298 |
add_custom_target(translate COMMAND ${CMAKE_COMMAND}
|
| 299 |
-D "PROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}"
|
| 300 |
-D "COPYRIGHT_HOLDERS=${COPYRIGHT_HOLDERS}"
|
| 301 |
-
-D "LCONVERT_EXECUTABLE=$<TARGET_FILE:Qt6::lconvert>"
|
| 302 |
-
-D "LUPDATE_EXECUTABLE=$<TARGET_FILE:Qt6::lupdate>"
|
| 303 |
-D "XGETTEXT_EXECUTABLE=${XGETTEXT_EXECUTABLE}"
|
| 304 |
-P ${PROJECT_SOURCE_DIR}/share/qt/translate.cmake
|
| 305 |
)
|
|
|
|
| 11 |
string(APPEND CMAKE_OBJCXX_COMPILE_OBJECT " ${APPEND_CPPFLAGS} ${APPEND_CXXFLAGS}")
|
| 12 |
endif()
|
| 13 |
|
| 14 |
+
get_target_property(qt_lib_type Qt${WITH_QT_VERSION}::Core TYPE)
|
| 15 |
|
| 16 |
function(import_plugins target)
|
| 17 |
if(qt_lib_type STREQUAL "STATIC_LIBRARY")
|
| 18 |
+
set(plugins Qt${WITH_QT_VERSION}::QMinimalIntegrationPlugin)
|
| 19 |
if(CMAKE_SYSTEM_NAME MATCHES "^(Linux|FreeBSD)$")
|
| 20 |
+
list(APPEND plugins Qt${WITH_QT_VERSION}::QXcbIntegrationPlugin)
|
| 21 |
elseif(WIN32)
|
| 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()
|
| 28 |
elseif(APPLE)
|
| 29 |
+
list(APPEND plugins Qt${WITH_QT_VERSION}::QCocoaIntegrationPlugin Qt${WITH_QT_VERSION}::QMacStylePlugin)
|
| 30 |
endif()
|
| 31 |
+
cmake_language(CALL "qt${WITH_QT_VERSION}_import_plugins" ${target}
|
| 32 |
INCLUDE ${plugins}
|
| 33 |
EXCLUDE_BY_TYPE
|
| 34 |
accessiblebridge
|
|
|
|
| 59 |
set(CMAKE_AUTOUIC ON)
|
| 60 |
set(CMAKE_AUTOUIC_SEARCH_PATHS forms)
|
| 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 |
+
|
| 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)
|
| 123 |
|
| 124 |
# The bitcoinqt sources have to include headers in
|
| 125 |
# order to parse them to collect translatable strings.
|
|
|
|
| 186 |
$<$<PLATFORM_ID:Windows>:winshutdownmonitor.h>
|
| 187 |
bitcoin.qrc
|
| 188 |
${CMAKE_CURRENT_BINARY_DIR}/bitcoin_locale.qrc
|
| 189 |
+
${CMAKE_CURRENT_BINARY_DIR}/bitcoin_rendered.qrc
|
| 190 |
)
|
| 191 |
target_compile_definitions(bitcoinqt
|
| 192 |
PUBLIC
|
|
|
|
| 203 |
)
|
| 204 |
target_link_libraries(bitcoinqt
|
| 205 |
PUBLIC
|
| 206 |
+
Qt${WITH_QT_VERSION}::Widgets
|
| 207 |
PRIVATE
|
| 208 |
core_interface
|
| 209 |
bitcoin_cli
|
|
|
|
| 213 |
$<$<PLATFORM_ID:Darwin>:-framework\ AppKit>
|
| 214 |
$<$<CXX_COMPILER_ID:MSVC>:shlwapi>
|
| 215 |
)
|
| 216 |
+
add_dependencies(bitcoinqt generate_roots_splash)
|
| 217 |
|
| 218 |
if(ENABLE_WALLET)
|
| 219 |
target_sources(bitcoinqt
|
|
|
|
| 282 |
target_link_libraries(bitcoinqt
|
| 283 |
PRIVATE
|
| 284 |
bitcoin_wallet
|
| 285 |
+
Qt${WITH_QT_VERSION}::Network
|
| 286 |
)
|
| 287 |
endif()
|
| 288 |
|
| 289 |
if(WITH_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 |
+
)
|
| 303 |
endif()
|
| 304 |
|
| 305 |
if(qt_lib_type STREQUAL "STATIC_LIBRARY")
|
| 306 |
# We want to define static plugins to link ourselves, thus preventing
|
| 307 |
# automatic linking against a "sane" set of default static plugins.
|
| 308 |
+
cmake_language(CALL "qt${WITH_QT_VERSION}_import_plugins" bitcoinqt
|
| 309 |
EXCLUDE_BY_TYPE
|
| 310 |
accessiblebridge
|
| 311 |
platforms
|
|
|
|
| 331 |
../init/bitcoin-qt.cpp
|
| 332 |
)
|
| 333 |
|
| 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()
|
| 342 |
add_windows_application_manifest(bitcoin-qt)
|
| 343 |
|
| 344 |
target_link_libraries(bitcoin-qt
|
|
|
|
| 384 |
add_custom_target(translate COMMAND ${CMAKE_COMMAND}
|
| 385 |
-D "PROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}"
|
| 386 |
-D "COPYRIGHT_HOLDERS=${COPYRIGHT_HOLDERS}"
|
| 387 |
+
-D "LCONVERT_EXECUTABLE=$<TARGET_FILE:Qt${WITH_QT_VERSION}::lconvert>"
|
| 388 |
+
-D "LUPDATE_EXECUTABLE=$<TARGET_FILE:Qt${WITH_QT_VERSION}::lupdate>"
|
| 389 |
-D "XGETTEXT_EXECUTABLE=${XGETTEXT_EXECUTABLE}"
|
| 390 |
-P ${PROJECT_SOURCE_DIR}/share/qt/translate.cmake
|
| 391 |
)
|