QT_EXCLUDE_SOURCES_FROM_TRANSLATION

This property was introduced in Qt 6.7.

This target property specifies a list of source file paths that are excluded from translation. Source files that match the patterns in this exclusion list are ignored by lupdate.

The paths may be absolute or relative to CMAKE_CURRENT_SOURCE_DIR. The paths may contain wildcards in a format that is accepted by QRegularExpression::wildcardToRegularExpression.

 qt_add_executable(myapp
     main.cpp
     untranslatable.cpp
     3rdparty/sqlite3.h
     3rdparty/sqlite3.c
 )
 set_property(TARGET myapp PROPERTY QT_EXCLUDE_SOURCES_FROM_TRANSLATION
     untranslatable.cpp
     3rdparty/*
 )

See also qt_add_lupdate, target property QT_EXCLUDE_FROM_TRANSLATION, and directory property QT_EXCLUDE_FROM_TRANSLATION.