本页内容

编辑 vcpkg 清单文件

当您打开vcpkg.json 文件时,它将在vcpkg清单文件编辑器中打开:

清单文件编辑器中的 vcpkg.json 文件

添加待管理的软件包

要将软件包添加到项目中:

  1. 在清单编辑器工具栏上选择“添加 vcpkg 软件包 ”(Add vcpkg Package )。

    “添加 vcpkg 包”对话框

  2. 选择要添加到项目中的软件包。
  3. 选择“OK ”以返回编辑器。
  4. 重复上述步骤以添加更多包。

生成 CMake 配置文件代码

要生成示例 CMake 代码并将其复制到 `CMakeLists.txt ` 文件中:

  1. 在清单编辑器工具栏上选择“CMake 代码 ”(CMake Code )。

    CMake 代码对话框

  2. 选择所需的示例代码,并将其复制粘贴到CMakeLists.txt 文件中。

设置 vcpkg 的路径

要设置 vcpkg 的安装目录路径,请在编辑器工具栏上选择““首选项”按钮 ”(Configure )。

另请参阅 “设置 vcpkg 包管理器”和“创建 vcpkg 清单文件”。

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.