Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qt_set_harmonyos_app_metadata.qdoc
Go to the documentation of this file.
1
// Copyright (C) 2026 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4
/*!
5
\page qt-set-harmonyos-app-metadata.html
6
\ingroup cmake-commands-qtcore
7
8
\title qt_set_harmonyos_app_metadata
9
\keyword qt6_set_harmonyos_app_metadata
10
11
\summary {Sets HarmonyOS application-level metadata on the target.}
12
13
\include cmake-find-package-core.qdocinc
14
15
\cmakecommandsince 6.12
16
\preliminarycmakecommand
17
\cmakecommandharmonyosonly
18
19
\section1 Synopsis
20
21
\badcode
22
qt_set_harmonyos_app_metadata(target
23
[VENDOR <string>]
24
[VERSION_CODE <integer>]
25
[VERSION_NAME <string>]
26
[LABEL <label>]
27
[ICON <icon>]
28
[COMPATIBLE_SDK_VERSION <string>]
29
[TARGET_SDK_VERSION <string>]
30
[COMPILE_SDK_VERSION <string>]
31
)
32
\endcode
33
34
\versionlessCMakeCommandsNote qt6_set_harmonyos_app_metadata()
35
36
\section1 Description
37
38
The command sets application-level metadata for the HarmonyOS \c {target}
39
executable. The values are conceptually app-scoped (one application maps to one
40
bundle) and are baked into \c {AppScope/app.json5} and
41
\c {entry/build-profile.json5} when the HAP package is built. Module-scoped
42
metadata, such as the description or orientation, is set with
43
\l{qt6_set_harmonyos_module_metadata}{qt_set_harmonyos_module_metadata()}
44
instead.
45
46
\section1 Arguments
47
48
\c VENDOR is the name of the application vendor.
49
50
\c VERSION_CODE is the integer version code of the application. It is an
51
internal version number that is not shown to the user.
52
53
\c VERSION_NAME is the human-readable version string of the application, for
54
example \c {1.0.0}.
55
56
\c LABEL is the application name shown to the user. It accepts either a literal
57
string or a \c {$string:<name>} resource reference that resolves to a localized
58
string from the application's resource files.
59
60
\c ICON is the application icon. It accepts either a path to an image file or a
61
\c {$media:<name>} resource reference. A relative path is resolved against the
62
\c CMAKE_CURRENT_SOURCE_DIR of the calling directory. When a file path is given,
63
the image is copied into the bundle's media resources and a \c {$media:}
64
reference is generated for it.
65
66
\c COMPATIBLE_SDK_VERSION, \c TARGET_SDK_VERSION, and \c COMPILE_SDK_VERSION set
67
the corresponding SDK version fields in \c {entry/build-profile.json5}. The
68
values are substituted verbatim, so they must use the format expected by the
69
HarmonyOS toolchain, for example \c {COMPATIBLE_SDK_VERSION "5.0.0(12)"} and
70
\c {TARGET_SDK_VERSION "14"}.
71
72
An option that is not specified is not written to the manifest. The
73
corresponding field then keeps the value defined by the package template, so
74
the effective default for each option is whatever that template provides. See
75
\l{cmake-target-property-QT_HARMONYOS_PACKAGE_SOURCE_DIR}
76
{QT_HARMONYOS_PACKAGE_SOURCE_DIR} for how to inspect or replace that template.
77
78
\section1 Example
79
80
\snippet cmake-macros/examples.cmake qt_set_harmonyos_app_metadata
81
82
\sa {qt6_set_harmonyos_module_metadata}{qt_set_harmonyos_module_metadata()},
83
{Qt for HarmonyOS CMake API}
84
*/
qtbase
src
corelib
doc
src
cmake
qt_set_harmonyos_app_metadata.qdoc
Generated on
for Qt by
1.16.1