Build: Avoid building Qt Creator when running translation targets

The "project sources" contain lots of generated files that we are not
interested in, simply exclude anything from the build directory.
The *_tr.h header that we generate for the wizards and external tools
are handled separately.

Change-Id: I2ab1d6ac4312b1140ee475f8f16ba82d8488c43e
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Eike Ziller
2023-06-16 14:31:39 +02:00
parent 5ba10671da
commit fc236d4534

View File

@@ -30,7 +30,18 @@ function(_extract_ts_data_from_targets outprefix)
set(_target_sources "") set(_target_sources "")
if(_source_files) if(_source_files)
list(FILTER _source_files EXCLUDE REGEX ".*[.]json[.]in|.*[.]svg|.*[.]pro|.*[.]css") # exclude various funny source files, and anything generated
# like *metatypes.json.gen, moc_*.cpp, qrc_*.cpp, */qmlcache/*.cpp,
# *qmltyperegistrations.cpp
set(_exclude_patterns
.*[.]json[.]in
.*[.]svg
.*[.]pro
.*[.]css
"${PROJECT_BINARY_DIR}/.*"
)
list(JOIN _exclude_patterns "|" _exclude_pattern)
list(FILTER _source_files EXCLUDE REGEX "${_exclude_pattern}")
list(APPEND _target_sources ${_source_files}) list(APPEND _target_sources ${_source_files})
endif() endif()
if(_extra_translations) if(_extra_translations)