Build/translations: Fix if build dir contains regex characters

We need to escape all regex relevant characters before using the build
directory as part of a regex.

Amends fc236d4534

Change-Id: Idfb9e5a1733e153943781888976de97aac4fb8cb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
This commit is contained in:
Eike Ziller
2023-06-19 13:09:34 +02:00
parent 6c34e1937c
commit 694dec5b0f

View File

@@ -33,12 +33,13 @@ function(_extract_ts_data_from_targets outprefix)
# exclude various funny source files, and anything generated
# like *metatypes.json.gen, moc_*.cpp, qrc_*.cpp, */qmlcache/*.cpp,
# *qmltyperegistrations.cpp
string(REGEX REPLACE "(\\^|\\$|\\.|\\[|\\]|\\*|\\+|\\?|\\(|\\)|\\|)" "\\\\\\1" binary_dir_regex "${PROJECT_BINARY_DIR}")
set(_exclude_patterns
.*[.]json[.]in
.*[.]svg
.*[.]pro
.*[.]css
"${PROJECT_BINARY_DIR}/.*"
"${binary_dir_regex}/.*"
)
list(JOIN _exclude_patterns "|" _exclude_pattern)
list(FILTER _source_files EXCLUDE REGEX "${_exclude_pattern}")