本页内容

设置 vcpkg 软件包管理器

实验性 vcpkg 插件集成了vcpkgC/C++ 包管理器。它适用于所有支持的开发平台

创建并编辑vcpkg.json 文件,以便在使用 CMake 作为构建系统时指定要作为项目一部分构建的软件包。

注意: 启用 Vcpkg 插件才能使用它。

设置 vcpkg

要在命令行中设置 vcpkg,请输入

$ git clone https://github.com/microsoft/vcpkg
$ cd vcpkg

$ ./bootstrap-vcpkg.sh

设置 vcpkg 的路径

要将Path 设置为安装 vcpkg 的目录,请选择Preferences >CMake >Vcpkg

CMake 偏好设置中的 Vcpkg 选项卡

如果尚未安装 vcpkg,请选择网址 下载 vcpkg。

关闭自动设置

默认情况下,vcpkg 会自动设置为与 CMake 一起使用。要关闭自动设置,请选择Preferences >CMake >General >Package manager auto setup

CMake 偏好设置中的常规选项卡

另请参阅 创建 vcpkg 清单文件编辑 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.