[英]How to install packages when cloning project that uses vcpkg
I am trying out vcpkg package manager but I am running in some issues.我正在试用 vcpkg package 管理器,但遇到了一些问题。 I have a c++ project that uses cmake and vcpkg and have used vcpkg to install the cache2 package. Now everything works but as soon as I push the project and clone it I can't find how to restore the installed packages.
我有一个 c++ 项目,它使用 cmake 和 vcpkg,并使用 vcpkg 安装 cache2 package。现在一切正常,但是一旦我推送项目并克隆它,我就找不到如何恢复已安装的包。
What I have done is this:我所做的是:
Till here everything works fine now when I push and clone the project it goes wrong.到这里为止一切正常,当我推送和克隆项目出错时。
Now nothing appears to be installed and I don't want everyone to install all the packages one by one when they clone.现在似乎没有安装任何东西,我不希望每个人在克隆时都一个一个地安装所有的包。 Is there someway to automatically install all packages when cloning?
有没有办法在克隆时自动安装所有软件包?
I have found a decent solution using vcpkg manifests, it is still an experimental feature but I haven't had any issues with it yet.我找到了一个使用 vcpkg 清单的不错的解决方案,它仍然是一个实验性功能,但我还没有遇到任何问题。 In order to use manifests do the following:
要使用清单,请执行以下操作:
{
"name": "projectname", // should be lowercase, uppercase will give an error
"version-string": "0.1.0",
"dependencies": [ // add here your dependencies you would normally install with vcpkg install [package name]
"catch2"
]
}
In order to remove packages just remove the dependencies from the list and run the above command.为了删除包,只需从列表中删除依赖项并运行上面的命令。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.