cmake: Switch from AUTORCC to qt6_add_resources

This change provides finer control over the compilation of RCC-generated
files.
This commit is contained in:
Hennadii Stepanov
2025-11-10 15:14:46 +00:00
committed by fanquake
parent 25ae14c339
commit aabc5ca6ed

View File

@@ -50,11 +50,13 @@ endfunction()
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOMOC_MOC_OPTIONS "-p${CMAKE_CURRENT_SOURCE_DIR}")
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOUIC_SEARCH_PATHS forms)
set(CMAKE_AUTORCC OFF)
configure_file(bitcoin_locale.qrc bitcoin_locale.qrc USE_SOURCE_PERMISSIONS COPYONLY)
qt6_add_resources(BITCOIN_QRC bitcoin.qrc)
qt6_add_resources(BITCOIN_LOCALE_QRC ${CMAKE_CURRENT_BINARY_DIR}/bitcoin_locale.qrc)
# The bitcoinqt sources have to include headers in
# order to parse them to collect translatable strings.
@@ -119,8 +121,8 @@ add_library(bitcoinqt STATIC EXCLUDE_FROM_ALL
utilitydialog.h
$<$<PLATFORM_ID:Windows>:winshutdownmonitor.cpp>
$<$<PLATFORM_ID:Windows>:winshutdownmonitor.h>
bitcoin.qrc
${CMAKE_CURRENT_BINARY_DIR}/bitcoin_locale.qrc
${BITCOIN_QRC}
${BITCOIN_LOCALE_QRC}
)
target_compile_definitions(bitcoinqt
PUBLIC