Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
cmake-variables.qdoc
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4/*!
5\group cmake-variables-qtqml
6\title CMake Global Variables in Qt6 Qml
7
8\l{CMake Command Reference#Qt6::Qml}{CMake Commands} know about the following
9global CMake variables:
10
11*/
12
13/*!
14\page cmake-variable-qt-qml-output-directory.html
15\ingroup cmake-variables-qtqml
16
17\title QT_QML_OUTPUT_DIRECTORY
18
19\brief Base output directory below which QML modules will be created by default.
20
21The \l{qt6_add_qml_module}{qt6_add_qml_module()} command accepts an
22\c OUTPUT_DIRECTORY argument which specifies where the QML module's \c qmldir
23file, typeinfo file and plugin library will be created. When that argument is
24not used, the default value is based on the \c QT_QML_OUTPUT_DIRECTORY variable,
25if it is set. If \c QT_QML_OUTPUT_DIRECTORY is not set, the default value
26depends on the type of backing target (see the
27\l{qt6_add_qml_module#OUTPUT_DIRECTORY}{OUTPUT_DIRECTORY} documentation for
28details).
29
30When \c QT_QML_OUTPUT_DIRECTORY is set, the default output directory will be
31formed by appending the QML module's \e{target path} (which is based on the
32module URI) to \c QT_QML_OUTPUT_DIRECTORY.
33The \c QT_QML_OUTPUT_DIRECTORY will also be added to the import path of the
34\c qmllint and \c qmlcachegen tooling targets, allowing them to find other QML
35modules under the same base location. This allows the project to use a source
36directory structure that doesn't exactly match the URI structure of the QML
37modules, or to merge sets of QML modules under a common base point.
38*/
39
40/*!
41\page cmake-variable-qt-qml-generate-qmlls-ini.html
42\ingroup cmake-variables-qtqml
43
44\title QT_QML_GENERATE_QMLLS_INI
45
46\brief Enables autogeneration of .qmlls.ini files for \QMLLS.
47\cmakevariablesince 6.7
48
49\c QT_QML_GENERATE_QMLLS_INI is a boolean that describes whether
50\l{qt6_add_qml_module}{qt6_add_qml_module()} calls generate \c{.qmlls.ini} files inside
51the \b{source folder}, into each subdirectory with a CMakeLists.txt file creating a QML module.
52If \c{.qmlls.ini} files already exist there, then they are overwritten.
53
54\note Using \c QT_QML_GENERATE_QMLLS_INI requires a CMake version >= 3.19.
55
56These \c{.qmlls.ini} files contain the path to the last configured build directory,
57and is needed by \l{\QMLLS Reference}{\QMLLS} to find user defined modules. See also
58\l{\QMLLS Reference}{\QMLLS} about the other ways of passing build folders to \QMLLS.
59
60
61As this variable is used for IDE integration, it should normally not be set in a project itself, but
62passed to CMake via an IDE or manually by passing
63\badcode
64-DQT_QML_GENERATE_QMLLS_INI=ON
65\endcode
66to the cmake executable.
67
68\warning The files generated by \c QT_QML_GENERATE_QMLLS_INI are only valid for the current
69configuration and should be ignored by your version control system. For Git, add \tt{**\/.qmlls.ini}
70to your top-level project \c{.gitignore}, for example.
71The globbing is required because .qmlls.ini files are generated in \e{all source
72subdirectories} that define QML Modules.
73
74*/
75
76