mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 15:19:07 +01:00
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:
@@ -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
|
||||
|
||||
13
src/qt/locale/CMakeLists.txt
Normal file
13
src/qt/locale/CMakeLists.txt
Normal 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)
|
||||
Reference in New Issue
Block a user