Qt for HarmonyOS - Building from Source
Note: Qt for HarmonyOS is in technology preview and may change in future releases.
This page describes how to configure and build Qt for HarmonyOS from source.
Prerequisites
Before continuing, make sure you meet all requirements from Qt for HarmonyOS Prerequisites.
Building Qt for HarmonyOS is a cross-compilation: you build the Qt libraries for the HarmonyOS target using build tools from a matching host Qt build. You therefore need a Qt build for your host platform first. For general background on cross-compiling Qt, see Qt for Device Creation and Cross-compiling Qt.
Configuring and building
Configure Qt for HarmonyOS by pointing the build at the OpenHarmony SDK and the host Qt build:
configure -ohos-sdk <SDK_ROOT> -qt-host-path <HOST_QT_PATH> -ohos-arch arm64-v8a
cmake --build .The relevant configure options are:
-ohos-sdksets the OpenHarmony SDK root path. If omitted,configureuses the value of theOHOS_SDK_ROOTenvironment variable.-ohos-archsets the target architecture. Usearm64-v8afor physical devices andx86_64for the emulator. If omitted,configureselects an architecture based on the SDK.-qt-host-pathspecifies the path to the Qt host build used for cross-compiling.
Installing
After the build finishes, install Qt for HarmonyOS:
cmake --install .By default, Qt is installed into /usr/local/Qt-<version>. Pass the -prefix option to configure to install into a different location. The resulting Qt for HarmonyOS installation is what you use to build and deploy applications, as described in Building and Deploying Qt Applications for HarmonyOS.
© 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.