Skip to content
Snippets Groups Projects
Commit c26dfbc1 authored by Alexandru Croitor's avatar Alexandru Croitor
Browse files

More Qt CMake 6.7 API review

parent 334e1685
No related branches found
No related tags found
No related merge requests found
## Changes # Changes
Still to be processed:
https://codereview.qt-project.org/c/qt/qttools/+/495546 - Allow specifying multiple targets in qt_add_lupdate
https://codereview.qt-project.org/c/qt/qttools/+/496434 - Add qt6_collect_i18n_targets
https://codereview.qt-project.org/c/qt/qttools/+/498033 - Support project-wide i18n with qt_add_translations
https://codereview.qt-project.org/c/qt/qttools/+/498913 - Allow excluding target sources from i18n
https://codereview.qt-project.org/c/qt/qttools/+/501634 - Automatically determine .ts file names in qt_add_translations
https://codereview.qt-project.org/c/qt/qttools/+/502121 - Add a way to specify the native language for i18n
https://codereview.qt-project.org/c/qt/qttools/+/503733 - Automatically determine the path of the native .ts file
## qbase ## qbase
### `qt_standard_project_setup` - API Change ### `qt_standard_project_setup` - API Change and new variables
Add `I18N_LANGUAGES` keyword to `qt_standard_project_setup`. Add `I18N_LANGUAGES` keyword to `qt_standard_project_setup`.
Add `I18N_NATIVE_LANGUAGE` keyword to `qt_standard_project_setup`. Add `I18N_NATIVE_LANGUAGE` keyword to `qt_standard_project_setup`.
Added variable `QT_I18N_LANGUAGES` to specify the languages that are used for i18n in the project.
Added variable `QT_I18N_NATIVE_LANGUAGE` to specify the native language that is used in the source
code for translatable strings.
https://doc-snapshots.qt.io/qt6-dev/qt-standard-project-setup.html#synopsis https://doc-snapshots.qt.io/qt6-dev/qt-standard-project-setup.html#synopsis
https://doc-snapshots.qt.io/qt6-dev/cmake-variable-qt-i18n-languages.html
https://doc-snapshots.qt.io/qt6-dev/cmake-variable-qt-i18n-native-language.html
https://codereview.qt-project.org/c/qt/qtbase/+/501500 https://codereview.qt-project.org/c/qt/qtbase/+/501500
https://codereview.qt-project.org/c/qt/qtbase/+/503262 https://codereview.qt-project.org/c/qt/qtbase/+/503262
Documented. Documented.
No example snippet. No example snippets, neither for options nor the variables.
There is an exmaple snippet in doc page of `qt_add_translations`, but there's no direct link back.
Has "since qt version" blurb. Has "since qt version" blurb.
**Notes:** **Notes:**
...@@ -174,7 +162,7 @@ https://doc-snapshots.qt.io/qt6-dev/qtshadertools-build.html#multiview ...@@ -174,7 +162,7 @@ https://doc-snapshots.qt.io/qt6-dev/qtshadertools-build.html#multiview
https://codereview.qt-project.org/c/qt/qtshadertools/+/485678 https://codereview.qt-project.org/c/qt/qtshadertools/+/485678
Documented in CMake. Documented.
No example snippet. No example snippet.
Has "since qt version" blurb. Has "since qt version" blurb.
...@@ -206,7 +194,7 @@ https://doc-snapshots.qt.io/qt6-dev/cmake-variable-qt-qml-generate-qmlls-ini.htm ...@@ -206,7 +194,7 @@ https://doc-snapshots.qt.io/qt6-dev/cmake-variable-qt-qml-generate-qmlls-ini.htm
https://codereview.qt-project.org/c/qt/qtdeclarative/+/495779 https://codereview.qt-project.org/c/qt/qtdeclarative/+/495779
Documented in CMake. Documented.
No example snippet. No example snippet.
No separate `qt_add_qml_module` option. No separate `qt_add_qml_module` option.
No "since qt version" blurb. No "since qt version" blurb.
...@@ -224,7 +212,7 @@ https://doc-snapshots.qt.io/qt6-dev/qt-generate-deploy-qml-app-script.html#descr ...@@ -224,7 +212,7 @@ https://doc-snapshots.qt.io/qt6-dev/qt-generate-deploy-qml-app-script.html#descr
https://codereview.qt-project.org/c/qt/qtdeclarative/+/518711 https://codereview.qt-project.org/c/qt/qtdeclarative/+/518711
Documented in CMake. Documented.
No example snippet. No example snippet.
No "since qt version" blurb. No "since qt version" blurb.
...@@ -258,7 +246,7 @@ function(qt6_generate_wayland_protocol_server_sources target) ...@@ -258,7 +246,7 @@ function(qt6_generate_wayland_protocol_server_sources target)
cmake_parse_arguments(arg "" "__QT_INTERNAL_WAYLAND_INCLUDE_DIR" "FILES" ${ARGN}) cmake_parse_arguments(arg "" "__QT_INTERNAL_WAYLAND_INCLUDE_DIR" "FILES" ${ARGN})
``` ```
No CMake documentation. No documentation.
No example snippet. No example snippet.
No "since qt version" blurb. No "since qt version" blurb.
...@@ -279,7 +267,7 @@ function(qt6_generate_wayland_protocol_client_sources target) ...@@ -279,7 +267,7 @@ function(qt6_generate_wayland_protocol_client_sources target)
cmake_parse_arguments(arg "NO_INCLUDE_CORE_ONLY" "__QT_INTERNAL_WAYLAND_INCLUDE_DIR" "FILES" ${ARGN}) cmake_parse_arguments(arg "NO_INCLUDE_CORE_ONLY" "__QT_INTERNAL_WAYLAND_INCLUDE_DIR" "FILES" ${ARGN})
``` ```
No CMake documentation. No documentation.
Could be considered TP because no docs for so long. Could be considered TP because no docs for so long.
No example snippet. No example snippet.
No "since qt version" blurb. No "since qt version" blurb.
...@@ -290,18 +278,28 @@ No "since qt version" blurb. ...@@ -290,18 +278,28 @@ No "since qt version" blurb.
## qttools ## qttools
### `qt_add_lupdate` - New API option ### `qt_add_lupdate` - New API option
Allow multiple calls of `qt_add_lupdate`. Allow multiple calls of `qt_add_lupdate`.
Add `[LUPDATE_TARGET target-name]` option. Added `[LUPDATE_TARGET target-name]` option.
https://doc-snapshots.qt.io/qt6-dev/qtlinguist-cmake-qt-add-lupdate.html https://doc-snapshots.qt.io/qt6-dev/qtlinguist-cmake-qt-add-lupdate.html
https://codereview.qt-project.org/c/qt/qttools/+/495544 https://codereview.qt-project.org/c/qt/qttools/+/495544
Documented in CMake. Documented.
No specific example snippet. No specific example snippet.
No "since qt version" blurb. No "since qt version" blurb.
...@@ -321,11 +319,275 @@ https://doc-snapshots.qt.io/qt6-dev/qtlinguist-cmake-qt-add-lrelease.html ...@@ -321,11 +319,275 @@ https://doc-snapshots.qt.io/qt6-dev/qtlinguist-cmake-qt-add-lrelease.html
https://codereview.qt-project.org/c/qt/qttools/+/496435 https://codereview.qt-project.org/c/qt/qttools/+/496435
Documented in CMake. Old signature
```cmake
qt_add_lrelease(target TS_FILES file1.ts [file2.ts ...]
[NO_TARGET_DEPENDENCY]
```
New signature
```cmake
qt_add_lrelease(TS_FILES file1.ts [file2.ts ...]
[LRELEASE_TARGET target-name]
[EXCLUDE_FROM_ALL]
```
Documented.
No specific example snippet. No specific example snippet.
No "since qt version" blurb for new / changed options. No "since qt version" blurb for new / changed options.
`NO_TARGET_DEPENDENCY` disappeared from docs. `NO_TARGET_DEPENDENCY` disappeared from docs, not mentioned in deprecated section.
First `target` option that is now deprecated is not documented. First `target` option that is now deprecated IS documented.
**Notes:**
**Action points:**
### `qt_add_lupdate` - New API options and changed option
Allow specifying multiple targets in `qt_add_lupdate`
https://doc-snapshots.qt.io/qt6-dev/qtlinguist-cmake-qt-add-lupdate.html
https://codereview.qt-project.org/c/qt/qttools/+/495546
Old signature
```cmake
qt_add_lupdate(target TS_FILES file1.ts [file2.ts ...]
```
New signature
```cmake
qt_add_lupdate(TS_FILES file1.ts [file2.ts ...]
[TARGETS target1 [target2 ...]]
```
Documented.
No specific example snippet.
No "since qt version" blurb for new / changed options.
First `target` option that is now deprecated IS documented.
**Notes:**
**Action points:**
### `qt_collect_i18n_targets` - New API
Add `qt_collect_i18n_targets`, collects targets that are eligible for translation.
https://doc-snapshots.qt.io/qt6-dev/qtlinguist-cmake-qt-collect-targets-for-translation.html
https://codereview.qt-project.org/c/qt/qttools/+/496434
Signature
```cmake
qt_collect_i18n_targets(out_var [DIRECTORY path])
```
Documented.
Has "since qt version" blurb.
Has example snippet.
**Notes:**
**Action points:**
### `QT_EXCLUDE_FROM_TRANSLATION` - New target and directory properties
Targets can be excluded from translation by setting the target property
`QT_EXCLUDE_FROM_TRANSLATION` to TRUE
Targets below a certain directory can be excluded from translation by
setting the directory property `QT_EXCLUDE_FROM_TRANSLATION` to TRUE.
https://doc-snapshots.qt.io/qt6-dev/cmake-directory-property-qt-exclude-from-translation.html
https://doc-snapshots.qt.io/qt6-dev/cmake-target-property-qt-exclude-from-translation.html
https://codereview.qt-project.org/c/qt/qttools/+/496434
Documented.
Has "since qt version" blurb.
No example snippets.
**Notes:**
**Action points:**
### `QT_EXCLUDE_SOURCES_FROM_TRANSLATION` - New target property
Allow excluding target sources from i18n.
The target property
`QT_EXCLUDE_SOURCES_FROM_TRANSLATION` was added to exclude source files of
a target from handling with lupdate.
https://doc-snapshots.qt.io/qt6-dev/cmake-target-property-qt-exclude-sources-from-translation.html
https://codereview.qt-project.org/c/qt/qttools/+/498913
Signature
```cmake
set_property(TARGET myapp PROPERTY QT_EXCLUDE_SOURCES_FROM_TRANSLATION
untranslatable.cpp
3rdparty/*
)
```
Documented.
Has "since qt version" blurb.
Has example snippet.
**Notes:**
**Action points:**
### `qt_add_translations` - New API options and behavior change
Support project-wide i18n with `qt_add_translations`.
Gained the `TARGETS` argument to specify multiple targets that intend to load .qm files.
Gained the `SOURCE_TARGETS` argument to specify multiple targets that contain sources with
translatable strings.
If the first argument of `qt_add_translations` is a target, that target is not used
anymore for extracting translatable sources.
Now defers itself to the end of the scope of `PROJECT_SOURCE_DIR` if `SOURCE_TARGETS` is not given.
This behavior can be turned off by passing `IMMEDIATE_CALL`.
https://doc-snapshots.qt.io/qt6-dev/qtlinguist-cmake-qt-add-translations.html
https://codereview.qt-project.org/c/qt/qttools/+/498033
Old signature
```cmake
qt_add_translations(target TS_FILES file1.ts [file2.ts ...]
```
New signature
```cmake
qt_add_translations([target]
[TARGETS target1 [target2...]]
[SOURCE_TARGETS target1 [target2...]]
TS_FILES file1.ts [file2.ts ...]
[IMMEDIATE_CALL])
```
Documented.
No `IMMEDIATE_CALL` example snippet.
Partial "since qt version" blurb for new / changed options.
**Notes:**
**Action points:**
### `qt_add_translations` - New API options and behavior change
Automatically determine `.ts` file names in `qt_add_translations`
The `TS_FILES` argument of `qt_add_translations` is
optional now, and .ts file paths can be automatically determined after
setting the `QT_I18N_LANGUAGES` variable.
https://doc-snapshots.qt.io/qt6-dev/qtlinguist-cmake-qt-add-translations.html
https://codereview.qt-project.org/c/qt/qttools/+/501634
Old signature
```cmake
qt_add_translations([target]
TS_FILES file1.ts [file2.ts ...]
```
New signature
```cmake
qt_add_translations([target]
[TS_FILE_BASE name]
[TS_FILE_DIR directory]
[TS_FILES file1.ts [file2.ts ...]]
```
Documented.
Has example snippet.
No "since qt version" blurb for new options.
**Notes:**
**Action points:**
### `qt_add_translations` - Behavior change
Automatically determine the path of the native .ts file
If the `TS_FILES` argument is not passed to
`qt_add_translations`, the path to the native .ts file is automatically
determined if `QT_I18N_NATIVE_LANGUAGE` variable is set.
https://doc-snapshots.qt.io/qt6-dev/qtlinguist-cmake-qt-add-translations.html
https://codereview.qt-project.org/c/qt/qttools/+/503733
Documented.
No example / comparison snippet.
No "since qt version" blurb for new options.
**Notes:**
**Action points:**
### `qt_add_lupdate` - New API options and behavior change
Add a way to specify the native language for i18n
https://doc-snapshots.qt.io/qt6-dev/qtlinguist-cmake-qt-add-translations.html
https://codereview.qt-project.org/c/qt/qttools/+/502121
Old signature
```cmake
qt_add_lupdate(TS_FILES file1.ts [file2.ts ...]
```
New signature
```cmake
qt_add_lupdate(TS_FILES file1.ts [file2.ts ...]
[NATIVE_TS_FILE file.ts]
```
Documented.
No example snippet.
No "since qt version" blurb for new options.
**Notes:** **Notes:**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment