AUTOGEN_BETTER_GRAPH_MULTI_CONFIG

当此布尔属性启用时,CMake 将生成更多针对每个配置的目标。因此,对于多配置生成器而言,依赖关系图将更加准确,并可避免部分重新编译操作。

自 Qt 6.8 起,此属性默认处于启用状态。对于较旧的版本,您需要手动启用它才能使用。 不过,qt_extract_metatypes和qt_add_qml_module已在 Qt 6.8 中更新以支持AUTOGEN_BETTER_GRAPH_MULTI_CONFIG ,因此除非对旧版 Qt 进行补丁以支持该功能,否则您将遇到构建错误。

要全局设置此属性,请使用以下命令:

set(CMAKE_AUTOGEN_BETTER_GRAPH_MULTI_CONFIG ON)

或在目标上进行设置:

set_target_properties(app PROPERTIES AUTOGEN_BETTER_GRAPH_MULTI_CONFIG ON)

有关更多信息,请参阅AUTOGEN_BETTER_GRAPH_MULTI_CONFIG。

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