aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/doc/src/cmake/cmake-variables.qdoc
blob: f89dab228adcb2db3b8574b2c0f4de6e75816903 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

/*!
\page cmake-variable-QT_QML_OUTPUT_DIRECTORY.html
\ingroup cmake-variables-qtqml

\title QT_QML_OUTPUT_DIRECTORY
\target cmake-variable-QT_QML_OUTPUT_DIRECTORY

\brief Base output directory below which QML modules will be created by default.

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

When \c QT_QML_OUTPUT_DIRECTORY is set, the default output directory will be
formed by appending the QML module's \e{target path} (which is based on the
module URI) to \c QT_QML_OUTPUT_DIRECTORY.
The \c QT_QML_OUTPUT_DIRECTORY will also be added to the import path of the
\c qmllint and \c 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.

When building QML modules for Android, \c QT_QML_OUTPUT_DIRECTORY is set to
\c{${CMAKE_BINARY_DIR}/android-qml} by default. The Android deployment routine
uses this directory to locate the required QML modules in the build tree.
The output directory of a QML module can also be set for a project or for each
QML module target by the user and it can therefore differ from the Android
default directory. In this case, to successfully deploy the executable on
Android, the \e{target path} of the QML module must be based on the module URI.
Also, the \l{cmake-target-property-QT_QML_IMPORT_PATH}{QT_QML_IMPORT_PATH}
property of the executable target must contain the import paths of all QML
modules that are built in the project tree, have a custom output directory,
and are used by the executable target. This behavior will likely change in
a future Qt version due to improvements in the build system implementation.

*/