aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/doc/src/cmake/cmake-variables.qdoc
blob: de984c88ef8c9f077a6db10af229a7968b9e4065 (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

/*!
\group cmake-variables-qtqml
\title CMake Global Variables in Qt6 Qml

\l{CMake Command Reference#Qt6::Qml}{CMake Commands} know about the following
global CMake variables:

*/

/*!
\page cmake-variable-qt-qml-output-directory.html
\ingroup cmake-variables-qtqml

\title 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.
*/

/*!
\page cmake-variable-qt-qml-generate-qmlls-ini.html
\ingroup cmake-variables-qtqml

\title QT_QML_GENERATE_QMLLS_INI

\brief Enables autogeneration of .qmlls.ini files for \QMLLS.
\cmakevariablesince 6.7

\c QT_QML_GENERATE_QMLLS_INI is a boolean that describes whether
\l{qt6_add_qml_module}{qt6_add_qml_module()} calls generate \c{.qmlls.ini} files inside
the \b{source folder}, into each subdirectory with a CMakeLists.txt file creating a QML module.
If \c{.qmlls.ini} files already exist there, then they are overwritten.

\note Using \c QT_QML_GENERATE_QMLLS_INI requires a CMake version >= 3.19.

These \c{.qmlls.ini} files contain the path to the last configured build directory,
and is needed by \l{\QMLLS Reference}{\QMLLS} to find user defined modules. See also
\l{\QMLLS Reference}{\QMLLS} about the other ways of passing build folders to \QMLLS.


As this variable is used for IDE integration, it should normally not be set in a project itself, but
passed to CMake via an IDE or manually by passing
\badcode
-DQT_QML_GENERATE_QMLLS_INI=ON
\endcode
to the cmake executable.

\warning The files generated by \c QT_QML_GENERATE_QMLLS_INI are only valid for the current
configuration and should be ignored by your version control system. For Git, add \tt{**\/.qmlls.ini}
to your top-level project \c{.gitignore}, for example.
The globbing is required because .qmlls.ini files are generated in \e{all source
subdirectories} that define QML Modules.

*/