QT_QML_OUTPUT_DIRECTORY

The qt6_add_qml_module() command accepts an OUTPUT_DIRECTORY argument which specifies where the QML module's qmldir file, typeinfo file and plugin library will be created. When that argument is not used, the default value is based on the QT_QML_OUTPUT_DIRECTORY variable, if it is set. If QT_QML_OUTPUT_DIRECTORY is not set, the default value depends on the type of backing target (see the OUTPUT_DIRECTORY documentation for details).

When QT_QML_OUTPUT_DIRECTORY is set, the default output directory will be formed by appending the QML module's target path (which is based on the module URI) to QT_QML_OUTPUT_DIRECTORY. The QT_QML_OUTPUT_DIRECTORY will also be added to the import path of the qmllint and qmlcachegen tooling targets, allowing them to find other QML modules under the same base location. This allows the project to use a source directory structure that doesn't exactly match the URI structure of the QML modules, or to merge sets of QML modules under a common base point.

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