覆盖项目的 CMake 设置
覆盖当前项目的 CMake 设置:
- 转到Projects >Project Settings >CMake 。

- 清除Use global settings 。
- 为项目配置 CMake。
您的选择会覆盖在Preferences >CMake >General 中设置的值。
| 设置 | 值 | 读取更多 |
|---|---|---|
| Autorun CMake | 当您编辑项目中的CMakeLists.txt 配置文件时,运行 CMake 以刷新项目信息。此外,在构建项目时也会刷新项目信息。 | 查看 CMake 项目内容 |
| Clear old CMake output on a new run | 再次运行 CMake 时删除旧的输出。 | 查看 CMake 输出 |
| Package manager auto setup | 设置Conan或vcpkg软件包管理器,以便与 CMake 配合使用。 | 与软件包管理器一起使用 CMake |
| Maintenance Tool dependency provider | 使用Qt Online Installer 安装缺失的 Qt 模块。 | 安装缺失的 Qt 软件包 |
| Ask before re-configuring with initial parameters | 当您选择Re-configure with Initial Variables 时,先询问再行动。 | 使用初始变量重新配置 |
| Ask before reloading CMake presets | 当您进入Build 并选择Reload CMake Presets 时,会先询问再操作。 | CMake 预置 |
| Show subfolders inside source group folders | 在Projects 视图中隐藏子文件夹名称,并根据源组排列文件。 | 在项目视图中隐藏子文件夹名称 |
| Show advanced options by default | 在Initial Configuration 和Current Configuration 中默认显示所有 CMake 变量。 | 查看高级变量 |
| Use junctions for CMake configuration and build operations | 在 Windows 中,为 CMake 配置、构建和安装操作使用连接点。 | 在 Windows 上使用连接点 |
您可以将这些首选项设置为CMake 配置预设或在 CMakeLists.txt.shared文件中。
另请参阅 如何使用 CMake 构建、CMake 和构建并运行项目。
Copyright © The Qt Company Ltd. and other contributors. 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.