Qt6 QML 中的 CMake 全局变量

CMake 命令支持以下全局 CMake 变量:

QT_QMLLINT_CONTEXT_PROPERTY_DUMP

启用在 lint 目标中转储上下文属性。

QT_QML_GENERATE_AOTSTATS

控制是否启用 QML 编译器的统计信息收集。

QT_QML_GENERATE_QMLLS_INI

启用为QML Language Server 自动生成.qmlls.ini文件。

QT_QML_GENERATE_QMLLS_INI_NO_CMAKE_CALLS

自定义QML Language Server 的.qmlls.ini文件中no-cmake-calls的值。

QT_QML_NO_CACHEGEN

禁用将 QML 文件编译为字节码或 C++ 代码。

QT_QML_NO_QML_PREVIEW (global property)

控制是否为链接 Qt6::Qml 的可执行文件自动设置 qmlpreview 支持。

QT_QML_OUTPUT_DIRECTORY

默认情况下用于创建 QML 模块的基础输出目录。

© 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.