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.

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.