qt_qml_output_directory

qt6_add_qml_module()命令接受一个OUTPUT_DIRECTORY 参数,用于指定 QML 模块的qmldir 文件、typeinfo 文件和插件库的创建位置。如果没有使用该参数,默认值将基于QT_QML_OUTPUT_DIRECTORY 变量(如果已设置)。如果QT_QML_OUTPUT_DIRECTORY 未设置,默认值取决于后备目标的类型(详见OUTPUT_DIRECTORY文档)。

QT_QML_OUTPUT_DIRECTORY 被设置时,默认输出目录将通过把 QML 模块的目标路径(基于模块 URI)追加到QT_QML_OUTPUT_DIRECTORY 而形成。QT_QML_OUTPUT_DIRECTORY 也将被添加到qmllintqmlcachegen 工具目标的导入路径,使它们能在相同的基本位置下找到其他 QML 模块。这允许项目使用与 QML 模块 URI 结构不完全匹配的源目录结构,或将 QML 模块集合并到一个共同的基点下。

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