aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2024-08-15 16:10:00 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2024-08-16 08:48:41 +0000
commit1e1dd063160d3decef28659ac1ab932c4262926d (patch)
tree70405ac29934898da22e9dd618179bab48ee3f52
parent468d8f9e55adb5258ee2e401c8c278572e526e12 (diff)
CMake: Exclude QML *_tooling targets from i18n
For QML modules, we create *_tooling targets with source files assigned, which are located in the build directory. These sources are copies of files from the source directory and already belong to the actual QML module's target. When using qt_add_translations' automatic target collection, both targets contribute to the inputs of lupdate, resulting in duplicate source locations in .ts files. We now mark *_tooling targets as excluded from translation to avoid these duplicates. Implementation note: we don't need to set QT_EXCLUDE_FROM_TRANSLATION on the utility target for CMake < 3.19, because utility targets do not contribute to the input of lupdate. Fixes: QTBUG-124764 Change-Id: If5a8a19ff5503a6ea7d62a1f05957c7f1e8f315e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 506cac0194124153ab63ae6111d4c3e51e106a5d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit d5b6d0a4b751f706617a32098810ce46397418d1)
-rw-r--r--src/qml/Qt6QmlMacros.cmake1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/qml/Qt6QmlMacros.cmake b/src/qml/Qt6QmlMacros.cmake
index 6b694d60be..550a88f68f 100644
--- a/src/qml/Qt6QmlMacros.cmake
+++ b/src/qml/Qt6QmlMacros.cmake
@@ -2766,6 +2766,7 @@ function(qt6_target_qml_sources target)
if(NOT TARGET ${target}_tooling)
add_library(${target}_tooling INTERFACE)
add_dependencies(${target} ${target}_tooling)
+ set_target_properties(${target}_tooling PROPERTIES QT_EXCLUDE_FROM_TRANSLATION ON)
endif()
target_sources(${target}_tooling PRIVATE
${copied_files}