From 694dec5b0f04d82a4eaf6df8947a7cf5cb1e83c7 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 19 Jun 2023 13:09:34 +0200 Subject: [PATCH] Build/translations: Fix if build dir contains regex characters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We need to escape all regex relevant characters before using the build directory as part of a regex. Amends fc236d4534468fc0867e30843a109d9274ebba70 Change-Id: Idfb9e5a1733e153943781888976de97aac4fb8cb Reviewed-by: Christian Stenger Reviewed-by: Robert Löhning --- cmake/QtCreatorTranslations.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/QtCreatorTranslations.cmake b/cmake/QtCreatorTranslations.cmake index 94f28663483..7379f1e60cc 100644 --- a/cmake/QtCreatorTranslations.cmake +++ b/cmake/QtCreatorTranslations.cmake @@ -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}")