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. By default, the current binary directory (CMAKE_CURRENT_BINARY_DIR
) is used if that argument is not provided. When a set of QML modules are being defined, it may be convenient to have them all generated under a common point in the build directory. If the source directory structure doesn't match the URI structure of the QML modules, or if you just want your QML modules to be collected under a different location, the QT_QML_OUTPUT_DIRECTORY
can be used. When set, the default changes to the concatenation of QT_QML_OUTPUT_DIRECTORY
and the QML module's target path, which is based on the module URI. 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.