On this page

Qt for HarmonyOS CMake API

Note: The HarmonyOS CMake API is in technology preview and may change in future releases.

This page lists the CMake commands, target properties, and variables that configure how a Qt application is packaged into a HarmonyOS Ability Package (HAP).

When you create a Qt executable with qt_add_executable() while targeting HarmonyOS, Qt automatically generates a <target>_make_hap build target that produces the HAP. The commands, properties, and variables below control the contents of that HAP and the metadata written into the HarmonyOS manifest files.

A HarmonyOS application bundle is described by two kinds of manifest: the application-level app.json5, which holds metadata that applies to the whole bundle, and the module-level module.json5, which describes a single HAP module within that bundle. The metadata commands below mirror this split, so there is one command for each scope.

Commands

Target Properties

The following target properties affect how the HAP is built:

QT_HARMONYOS_APP_BUNDLE_NAME

The HarmonyOS application's bundle name.

QT_HARMONYOS_APP_NAME

The HarmonyOS application's name.

QT_HARMONYOS_EXTRA_LIBS

Extra libraries to deploy with the HarmonyOS target.

QT_HARMONYOS_EXTRA_PLUGINS

Extra Qt plugins to deploy with the HarmonyOS target.

QT_HARMONYOS_HVIGOR

Path to the hvigor wrapper used to build the HAP.

QT_HARMONYOS_PACKAGE_SOURCE_DIR

Path to a custom HarmonyOS package template.

QT_HARMONYOS_TARGET_ARCHS

The target architectures of the HarmonyOS application.

Variables

The following variables affect how the HAP is built:

QT_HARMONYOS_HVIGOR

Path to the hvigor wrapper used to build HAP packages.

© 2026 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.