From 10488623eb0baf70e906875b30d9c4d9067ea9b1 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 27 Jan 2023 11:28:23 +0100 Subject: 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 --- src/linguist/Qt6LinguistToolsMacros.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/linguist/Qt6LinguistToolsMacros.cmake') 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 "$") + set(exclude_regex "\\.ts$") + set(sources "$,EXCLUDE,${exclude_regex}>") endif() qt_internal_make_paths_absolute(ts_files "${arg_TS_FILES}") -- cgit v1.2.1