CMake Qt 供应商预设

CMakePresets.jsonCMakeUserPresets.json 中的vendor 部分指定Qt Creator 首选项。

CMake 配置预设

下表总结了可用的预设。

预设说明读取更多信息
AutorunCMake当您编辑项目中的CMakeLists.txt 配置文件时,运行 CMake 刷新项目信息。此外,在构建项目时也会刷新项目信息。查看 CMake 项目内容
AskBeforePresetsReload当您选择Build >Reload CMake Presets 时,先询问再行动。CMake 预置
AskReConfigureInitialParams当您选择Re-configure with Initial Variables 时,会在操作前询问。使用初始变量重新配置
PackageManagerAutoSetup设置Conanvcpkg软件包管理器以便与 CMake 配合使用。与软件包管理器一起使用 CMake
ShowAdvancedOptionsByDefaultInitial ConfigurationCurrent Configuration 中默认显示所有 CMake 变量。查看高级变量
ShowSourceSubfoldersProjects 视图中隐藏子文件夹名称,并根据源组排列文件。在项目视图中隐藏子文件夹名称
UseJunctionsForSourceAndBuildDirectories在 Windows 中,为 CMake 配置、构建和安装操作使用连接点。在 Windows 上使用连接点

CMake 配置预设示例:

"vendor": {
  "qt.io/QtCreator/1.0": {
    "AskBeforePresetsReload": false,
    "AskReConfigureInitialParams": false,
    "AutorunCMake": false,
    "PackageManagerAutoSetup": false,
    "ShowAdvancedOptionsByDefault": true,
    "ShowSourceSubFolders": false,
    "UseJunctionsForSourceAndBuildDirectories": true
  }
}

调试器预设

下表总结了可用的预设。

有关调试器首选项的更多信息,请参阅添加调试器

预设描述
Abis以逗号分隔的系统架构定义列表。
Binary调试器可执行文件的路径。可以是绝对路径、值auto 或 ABI。在Qt Creator 不知道二进制路径的情况下,为 MSVC 工具链查找适当的调试器。
DisplayName调试器名称。
EngineType调试器引擎类型:
  • 1 表示 GDB
  • 4 用于 CDB
  • 8 用于 PDB
  • 256 用于 LLDB
  • 512 用于 GDB DAP
  • 1024 用于 LLDB DAP
  • 4096 用于 uVision 调试器
Version调试器的版本号。

Qt Creator 调试器预设示例:

"vendor": {
  "qt.io/QtCreator/1.0": {
    "debugger": {
      "DisplayName": "GNU gdb 11.2.0 for MinGW 11.2.0 64-bit",
      "Abis": ["x86-windows-msys-pe-64bit"],
      "Binary": "C:/Qt/Tools/mingw1120_64/bin/gdb.exe",
      "EngineType": 1,
      "Version": "11.2.0"
    }
  }
}

另请参阅 CMake 编译配置CMakeCMake 预置SDK 工具

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.