Skip to content
Bitcoin Roots

v29.4-roots.1 · Commit 5: [PATCH 05/13] product: establish Roots identity and Qt experience

src/qt/CMakeLists.txt

Before: src/qt/CMakeLists.txt · After: src/qt/CMakeLists.txt

File metadata
index 797b49c624dd2b3a61b538d56368b4764702ead6..b2d7727fb635b152ee6c857dce798e1223b6839d 100644

Download original patch · Release notes

Diff rows 1–114 of 114. 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
@@ -47,7 +47,67 @@ file(GLOB ts_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} locale/*.ts)
47
47
  set_source_files_properties(${ts_files} PROPERTIES OUTPUT_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/locale)
48
48
  qt5_add_translation(qm_files ${ts_files})
49
49
 
50
+ set(ICON_PATH "res/rendered_icons")
51
+ set(ICO_SPECS
52
+ 256 64 48 32 24 20 16
53
+ )
54
+ set(ICNS_SPECS
55
+ 1024
56
+ )
57
+ set(bitcoin_svg "res/src/bitcoinroots-logo.svg")
58
+
59
+ file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${ICON_PATH}")
60
+ foreach(size IN LISTS ICO_SPECS ICNS_SPECS)
61
+ set(png "${ICON_PATH}/bitcoin${size}.png")
62
+ add_custom_command(
63
+ OUTPUT "${png}"
64
+ COMMAND "${RSVG_CONVERT}" -f png -d ${size} -p ${size} --output "${png}" "${CMAKE_CURRENT_SOURCE_DIR}/${bitcoin_svg}"
65
+ DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${bitcoin_svg}"
66
+ COMMENT "Generating ${png} from ${bitcoin_svg}"
67
+ VERBATIM
68
+ )
69
+ endforeach()
70
+
71
+ set(bitcoin_icns "${ICON_PATH}/bitcoin.icns")
72
+ add_custom_command(
73
+ OUTPUT "${bitcoin_icns}"
74
+ COMMAND "${PNG2ICNS}" "${bitcoin_icns}" "${ICON_PATH}/bitcoin1024.png"
75
+ DEPENDS "${ICON_PATH}/bitcoin1024.png"
76
+ COMMENT "Generating ${bitcoin_icns} from the Roots icon"
77
+ VERBATIM
78
+ )
79
+ add_custom_target(generate_icns DEPENDS "${bitcoin_icns}")
80
+
81
+ set(bitcoin_ico "${ICON_PATH}/bitcoin.ico")
82
+ set(testnet_ico "${ICON_PATH}/bitcoin_testnet.ico")
83
+ add_custom_command(
84
+ OUTPUT "${bitcoin_ico}"
85
+ 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}"
86
+ 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
87
+ COMMENT "Generating ${bitcoin_ico} from Roots icon sizes"
88
+ VERBATIM
89
+ )
90
+ add_custom_command(
91
+ OUTPUT "${testnet_ico}"
92
+ COMMAND "${IMAGEMAGICK_CONVERT}" "${bitcoin_ico}" -modulate 100,100,138.9 -colorspace HSL -channel G -evaluate subtract "11.76%" +channel -colorspace sRGB "${testnet_ico}"
93
+ DEPENDS "${bitcoin_ico}"
94
+ COMMENT "Generating ${testnet_ico} from ${bitcoin_ico}"
95
+ VERBATIM
96
+ )
97
+ add_custom_target(generate_ico DEPENDS "${bitcoin_ico}" "${testnet_ico}")
98
+
99
+ set(roots_logo_png "${ICON_PATH}/bitcoinroots-logo.png")
100
+ add_custom_command(
101
+ OUTPUT "${roots_logo_png}"
102
+ COMMAND "${RSVG_CONVERT}" -f png -d 960 -p 960 --output "${roots_logo_png}" "${CMAKE_CURRENT_SOURCE_DIR}/${bitcoin_svg}"
103
+ DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${bitcoin_svg}"
104
+ COMMENT "Generating ${roots_logo_png} from ${bitcoin_svg}"
105
+ VERBATIM
106
+ )
107
+ add_custom_target(generate_roots_splash DEPENDS "${roots_logo_png}")
108
+
50
109
  configure_file(bitcoin_locale.qrc bitcoin_locale.qrc USE_SOURCE_PERMISSIONS COPYONLY)
110
+ configure_file(bitcoin_rendered.qrc bitcoin_rendered.qrc USE_SOURCE_PERMISSIONS COPYONLY)
51
111
 
52
112
  # The bitcoinqt sources have to include headers in
53
113
  # order to parse them to collect translatable strings.
@@ -112,6 +172,7 @@ add_library(bitcoinqt STATIC EXCLUDE_FROM_ALL
112
172
  $<$<PLATFORM_ID:Windows>:winshutdownmonitor.h>
113
173
  bitcoin.qrc
114
174
  ${CMAKE_CURRENT_BINARY_DIR}/bitcoin_locale.qrc
175
+ ${CMAKE_CURRENT_BINARY_DIR}/bitcoin_rendered.qrc
115
176
  )
116
177
  target_compile_definitions(bitcoinqt
117
178
  PUBLIC
@@ -138,6 +199,7 @@ target_link_libraries(bitcoinqt
138
199
  $<$<PLATFORM_ID:Darwin>:-framework\ AppKit>
139
200
  $<$<CXX_COMPILER_ID:MSVC>:shlwapi>
140
201
  )
202
+ add_dependencies(bitcoinqt generate_roots_splash)
141
203
 
142
204
  if(ENABLE_WALLET)
143
205
  target_sources(bitcoinqt
@@ -214,6 +276,18 @@ if(WITH_DBUS)
214
276
  target_link_libraries(bitcoinqt PRIVATE Qt5::DBus)
215
277
  endif()
216
278
 
279
+ if(WITH_TASKBAR_PROGRESS)
280
+ target_sources(bitcoinqt
281
+ PRIVATE
282
+ $<$<PLATFORM_ID:Windows>:wintaskbarprogress.cpp>
283
+ $<$<PLATFORM_ID:Windows>:wintaskbarprogress.h>
284
+ )
285
+ target_link_libraries(bitcoinqt
286
+ PRIVATE
287
+ $<$<PLATFORM_ID:Windows>:ole32>
288
+ )
289
+ endif()
290
+
217
291
  if(qt_lib_type STREQUAL "STATIC_LIBRARY")
218
292
  # We want to define static plugins to link ourselves, thus preventing
219
293
  # automatic linking against a "sane" set of default static plugins.
@@ -227,7 +301,14 @@ add_executable(bitcoin-qt
227
301
  ../init/bitcoin-qt.cpp
228
302
  )
229
303
 
230
- add_windows_resources(bitcoin-qt res/bitcoin-qt-res.rc)
304
+ if(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin")
305
+ add_dependencies(bitcoin-qt generate_ico)
306
+ endif()
307
+
308
+ if(WIN32)
309
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/res/bitcoin-qt-res.rc ${CMAKE_CURRENT_BINARY_DIR}/res/bitcoin-qt-res.rc USE_SOURCE_PERMISSIONS @ONLY)
310
+ add_windows_resources(bitcoin-qt ${CMAKE_CURRENT_BINARY_DIR}/res/bitcoin-qt-res.rc)
311
+ endif()
231
312
 
232
313
  target_link_libraries(bitcoin-qt
233
314
  core_interface