1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
5\page cmake-variable-qt-qml-output-directory.html
6\ingroup cmake-variables-qtqml
8\title QT_QML_OUTPUT_DIRECTORY
10\brief Base output directory below which QML modules will be created by default.
12The \l{qt6_add_qml_module}{qt6_add_qml_module()} command accepts an
13\c OUTPUT_DIRECTORY argument which specifies where the QML module's \c qmldir
14file, typeinfo file and plugin library will be created. When that argument is
15not used, the default value is based on the \c QT_QML_OUTPUT_DIRECTORY variable,
16if it is set. If \c QT_QML_OUTPUT_DIRECTORY is not set, the default value
17depends on the type of backing target (see the
18\l{qt6_add_qml_module#OUTPUT_DIRECTORY}{OUTPUT_DIRECTORY} documentation for
21When \c QT_QML_OUTPUT_DIRECTORY is set, the default output directory will be
22formed by appending the QML module's \e{target path} (which is based on the
23module URI) to \c QT_QML_OUTPUT_DIRECTORY.
24The \c QT_QML_OUTPUT_DIRECTORY will also be added to the import path of the
25\c qmllint and \c qmlcachegen tooling targets, allowing them to find other QML
26modules under the same base location. This allows the project to use a source
27directory structure that doesn't exactly match the URI structure of the QML
28modules, or to merge sets of QML modules under a common base point.