编辑 vcpkg 清单文件

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

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

添加要管理的软件包

要在项目中添加软件包,请

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

    添加 vcpkg 软件包对话框

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

为 CMake 配置文件生成代码

生成 CMake 示例代码,复制到 CMakeLists.text 文件:

  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.