This command was introduced in Qt 6.2.
qt_add_lupdate(target TS_FILES file1.ts [file2.ts ...] [SOURCES source1.cpp [sources2.cpp ...]] [INCLUDE_DIRECTORIES directory1 [directory2 ...]] [NO_GLOBAL_TARGET] [OPTIONS ...])
If versionless commands are disabled, use qt6_add_lupdate()
instead. It supports the same set of arguments as this command.
Creates a target ${target}_lupdate
to generate or update Qt Linguist .ts
files with lupdate.
The parameter target
is an existing executable or library target that contains sources with translatable strings.
The .ts
files must be specified with the argument TS_FILES
.
This function is designed to be used in conjunction with qt_add_lrelease. See also the convenience wrapper qt_add_translations.
By default, qt_add_lupdate
extracts the source files and include directories from the given target and passes them to lupdate
.
With SOURCES
one may explicitly specify source files that contain translatable strings. This turns off the automatic extraction of source files from the target.
INCLUDE_DIRECTORIES
can be used to explicitly specify include directories. This turns off the automatic extraction of include directories from the target.
You can set additional OPTIONS
that should be passed when lupdate
is invoked. You can find possible options in the lupdate documentation.
In addition to the target ${target}_lupdate
, an umbrella target update_translations
is created. This target will build all ${target}_lupdate
targets that were created with
qt_add_lupdate
.
Pass NO_GLOBAL_TARGET
to qt_add_lupdate
to prevent this behavior.
The name of this target can be overridden by setting the variable QT_GLOBAL_LUPDATE_TARGET
before calling qt_add_lupdate
.
Add the targets myapp_lupdate
and update_translations
for updating the .ts
file of an application myapp
.
qt_add_lupdate(myapp TS_FILES myapp_de.ts)
As part of the free Business evaluation, we offer a free welcome call for companies, to talk about your requirements, and how the Felgo SDK & Services can help you. Just sign up and schedule your call.
Sign up now to start your free Business evaluation: