cmake, refactor: Move handling of Qt TS files into locale directory

This change offers a few advantages, such as:
- a more readable and cleaner `ts_files.cmake` (see the next commit);
- a scoped `ts_files` variable;
- improved code locality;
- no need to adjust the location of the resulting `*.qm` files.
This commit is contained in:
Hennadii Stepanov
2025-08-01 15:52:08 +01:00
parent 4f27e8ca4d
commit 95341de6ca
2 changed files with 14 additions and 7 deletions

View File

@@ -245,13 +245,7 @@ if(qt_lib_type STREQUAL "STATIC_LIBRARY")
)
endif()
file(GLOB ts_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} locale/*.ts)
set_source_files_properties(${ts_files} PROPERTIES OUTPUT_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/locale)
if(Qt6_VERSION VERSION_GREATER_EQUAL 6.7)
qt6_add_lrelease(TS_FILES ${ts_files} OPTIONS -silent)
else()
qt6_add_lrelease(bitcoinqt TS_FILES ${ts_files} OPTIONS -silent)
endif()
add_subdirectory(locale)
add_executable(bitcoin-qt
main.cpp

View File

@@ -0,0 +1,13 @@
# Copyright (c) 2025-present The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://opensource.org/license/mit/.
file(GLOB ts_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.ts")
if(Qt6_VERSION VERSION_GREATER_EQUAL 6.7)
qt6_add_lrelease(TS_FILES ${ts_files} LRELEASE_TARGET bitcoinqt_lrelease OPTIONS -silent)
else()
qt6_add_lrelease(bitcoinqt TS_FILES ${ts_files} OPTIONS -silent)
endif()
add_dependencies(bitcoinqt bitcoinqt_lrelease)