QT_QML_GENERATE_QMLLS_INI
启用为QML Language Server 自动生成.qmlls.ini文件的功能。
警告: 自 Qt 6.10 起,此 变量已弃用。无需替换。
该变量于 Qt 6.7 中引入。
QT_QML_GENERATE_QMLLS_INI 这是一个布尔值,用于描述qt_add_qml_module()调用是否会在源代码文件夹内,针对每个包含 CMakeLists.txt 文件且正在创建 QML 模块的子目录中生成.qmlls.ini 文件。如果该位置已存在.qmlls.ini 文件,则会将其覆盖。
注意:使用 QT_QML_GENERATE_QMLLS_INI 需要 CMake 版本 >= 3.19。
这些.qmlls.ini 文件包含最后配置的构建目录路径, QML Language Server 用于查找用户定义的模块。另请参阅 QML Language Server 有关将构建文件夹传递给QML Language Server 的其他方法。
由于该变量用于IDE集成,通常不应在项目内部直接设置,而应通过IDE传递,或通过向CMake可执行文件传递
-DQT_QML_GENERATE_QMLLS_INI=ON传递给 cmake 可执行文件。
警告: QT_QML_GENERATE_QMLLS_INI 生成的文件 仅对当前配置有效,应被版本控制系统忽略。对于 Git,请将**/.qmlls.ini 添加到项目根目录的.gitignore 中,例如。由于 .qmlls.ini 文件会生成在所有定义了 QML 模块的源代码子目录中,因此需要使用通配符。
另请参阅 QT_QML_GENERATE_QMLLS_INI_NO_CMAKE_CALLS和配置自动 CMake 构建。
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.