diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2023-01-27 11:28:23 +0100 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2023-01-27 11:42:13 +0100 |
commit | 10488623eb0baf70e906875b30d9c4d9067ea9b1 (patch) | |
tree | 2bac088e171b8bc44ea4a9b75111467d72262919 /src/linguist/Qt6LinguistToolsMacros.cmake | |
parent | 3c68d2711e203ae1f8b3434f3127ddf5a456c424 (diff) | |
download | qttools-10488623eb0baf70e906875b30d9c4d9067ea9b1.tar.gz |
CMake: Don't pass .ts files as sources to lupdate
With the qt6_add_lupdate command, lupdate gets passed a list of sources
of a target. This list might contain the .ts file.
There's an undocumented feature of lupdate: it can take .ts files as
additional sources for translation strings (see commit
b3f6b61a584fbaf047cf617a4b9cf8d9e92d2882). Having the same .ts file as
input and output for lupdate can result in accumulating duplicate
translations.
Filter the list of source files to exclude .ts files.
Pick-to: 6.5 6.4 6.2
Fixes: QTBUG-109316
Change-Id: Idea80e98655729167580b33bf7cb811653f407c7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src/linguist/Qt6LinguistToolsMacros.cmake')
-rw-r--r-- | src/linguist/Qt6LinguistToolsMacros.cmake | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/linguist/Qt6LinguistToolsMacros.cmake b/src/linguist/Qt6LinguistToolsMacros.cmake index bcca1789c..637202267 100644 --- a/src/linguist/Qt6LinguistToolsMacros.cmake +++ b/src/linguist/Qt6LinguistToolsMacros.cmake @@ -147,7 +147,8 @@ function(qt6_add_lupdate target) if(arg_SOURCES) qt_internal_make_paths_absolute(sources "${arg_SOURCES}") else() - set(sources "$<TARGET_PROPERTY:${target},SOURCES>") + set(exclude_regex "\\.ts$") + set(sources "$<FILTER:$<TARGET_PROPERTY:${target},SOURCES>,EXCLUDE,${exclude_regex}>") endif() qt_internal_make_paths_absolute(ts_files "${arg_TS_FILES}") |