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-for-harmonyos-cmake-api.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-for-harmonyos-cmake-api.html
6\title Qt for HarmonyOS CMake API
7\brief Overview of the CMake commands, properties, and variables for HarmonyOS
8deployment.
9
10\note The HarmonyOS CMake API is in technology preview and may change in
11future releases.
12
13This page lists the CMake commands, target properties, and variables that
14configure how a Qt application is packaged into a HarmonyOS Ability Package
15(HAP).
16
17When you create a Qt executable with
18\l qt_add_executable() while targeting HarmonyOS, Qt
19automatically generates a \c {<target>_make_hap} build target that produces the
20HAP. The commands, properties, and variables below control the contents of that
21HAP and the metadata written into the HarmonyOS manifest files.
22
23A HarmonyOS application bundle is described by two kinds of manifest: the
24application-level \c {app.json5}, which holds metadata that applies to the whole
25bundle, and the module-level \c {module.json5}, which describes a single HAP
26module within that bundle. The target properties below mirror this split: the
27\c QT_HARMONYOS_APP_* properties set application-level metadata, such as the
28\l{cmake-target-property-QT_HARMONYOS_APP_VENDOR}{vendor}, version, label, and
29icon, while properties such as
30\l{cmake-target-property-QT_HARMONYOS_MODULE_DESCRIPTION}{QT_HARMONYOS_MODULE_DESCRIPTION}
31and
32\l{cmake-target-property-QT_HARMONYOS_ABILITY_ORIENTATION}{QT_HARMONYOS_ABILITY_ORIENTATION}
33set module-level metadata. See the Target Properties section below for the full
34list.
35
36\section1 Commands
37
38\list
39\li \l qt_add_harmonyos_permission() adds a
40 HarmonyOS permission to the application.
41\endlist
42
43\section1 Target Properties
44
45The following target properties affect how the HAP is built:
46
47\annotatedlist cmake-harmonyos-build-properties
48
49\section1 Variables
50
51The following variables affect how the HAP is built:
52
53\annotatedlist cmake-harmonyos-build-variables
54*/