添加 CMake 工具

Qt Creator 会自动检测您在 中指定的 CMake 可执行文件。您可以添加其他 CMake 可执行文件的路径,并在不同的构建和运行PATH工具包中使用它们。

要查看Qt Creator 自动检测到的 CMake 安装:

  1. 选择首选项>CMake >Tools

    CMake 偏好设置中的 "工具 "选项卡

  2. Name 字段显示 CMake 安装的名称。
  3. Path 字段显示 CMake 可执行文件的路径。
  4. Help file 字段显示 CMake 随附的 CMake 帮助文件 (.qch) 的路径。

添加或删除 CMake 工具

要添加Qt Creator 不会自动检测的 CMake 可执行文件的路径,并为其指定设置,请选择Add

要在远程 Linux 设备或 Docker 中添加 CMake 可执行文件,请在Path 字段中的Browse (Choose on macOS) 下拉菜单中选择Remote

要更改自动检测到的安装,请选择Clone

要从列表中移除选定的 CMake 可执行文件,请选择Remove

设置默认 CMake 工具

Qt Creator 如果没有足够的信息来选择要使用的 CMake,则使用默认CMake。要将所选 CMake 可执行文件设为默认,请选择 。Make Default

将 CMake 工具添加到工具包

要在构建和运行工具包中添加 CMake 工具,请选择偏好设置>Kits 。工具包还会指定 CMake 生成器,用于生成Qt Creator 的项目文件和初始配置参数:

套件偏好

另请参阅 "在远程 Linux 设备上构建应用程序"、"在 Docker 设备上构建"、"如何:使用 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.