From fff13f885370c02e7b8696ecedbfafa436e48ace Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Fri, 2 Feb 2024 10:58:00 +0100 Subject: QT_QML_GENERATE_QMLLS_INI: improve documentation Address the comments from the API review, and link to it from qt_add_qml_module. Fixes: QTBUG-121703 Pick-to: 6.7 Change-Id: I711c1aa3c081509477798dc94b31826d546c1108 Reviewed-by: Alexey Edelev --- src/qml/doc/src/cmake/cmake-variables.qdoc | 13 +++++++++++-- src/qml/doc/src/cmake/qt_add_qml_module.qdoc | 3 +++ 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'src/qml/doc') diff --git a/src/qml/doc/src/cmake/cmake-variables.qdoc b/src/qml/doc/src/cmake/cmake-variables.qdoc index e2d6598ed1..79621542ca 100644 --- a/src/qml/doc/src/cmake/cmake-variables.qdoc +++ b/src/qml/doc/src/cmake/cmake-variables.qdoc @@ -44,11 +44,12 @@ modules, or to merge sets of QML modules under a common base point. \title QT_QML_GENERATE_QMLLS_INI \brief Enables autogeneration of .qmlls.ini files for QML Language Server +\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}. If \c{.qmlls.ini} files already exists in the source folder, -then they are overwritten. +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. @@ -56,6 +57,14 @@ These \c{.qmlls.ini} files contain the path to the last configured build directo and is needed by \l{QML Language Server} to find user defined modules. See also \l{QML Language Server} about the other ways of passing build folder to QML Language Server. + +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. + \note 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, this can be done by adding \c{.qmlls.ini} to your \c{.gitignore}, for example. diff --git a/src/qml/doc/src/cmake/qt_add_qml_module.qdoc b/src/qml/doc/src/cmake/qt_add_qml_module.qdoc index f0dc239f94..94a7a9d67f 100644 --- a/src/qml/doc/src/cmake/qt_add_qml_module.qdoc +++ b/src/qml/doc/src/cmake/qt_add_qml_module.qdoc @@ -62,6 +62,9 @@ qt_add_qml_module( See \l {Building a QML application} and \l {Building a reusable QML module} for examples that define QML modules. +See \l {QT_QML_GENERATE_QMLLS_INI} for configuring your project such that information about +QML modules is exposed to the \l{QML Language Server}. + \section1 Description This command defines a QML module that can consist of C++ sources, \c{.qml} -- cgit v1.2.3