QT_HARMONYOS_USE_TARGET_BUILD_DIR

Enables the use of per-target HarmonyOS build directories.

This variable was introduced in Qt 6.12.1.

Note: This variable is in technology preview and may change in future releases.

Note: This variable is used only if targeting the HarmonyOS platform.

Qt generates the HAP project of an executable target in a directory next to the target. By default, this directory is called harmonyos-build-<target>, so that several executable targets in the same CMakeLists.txt do not overwrite each other's HAP project.

Set this variable to OFF to use a directory called harmonyos-build instead. Only one executable target per CMakeLists.txt is supported then.

The build directory is also written as harmonyos-build-directory into the target's deployment settings file, where tools like Qt Creator read it.

See also Qt for HarmonyOS and Setting CMake variables and properties.

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