VS集成vcpkg
下载vcpkg
- 下载vcpkg
git clone https://github.com/Microsoft/vcpkg.git
- 安装vcpgk,文件目录
.\bootstrap-vcpkg.bat
集成到vs2022中
# 集成到项目
vcpkg integrate project
vcpkg integrate install
PS C:\Users\Administrator> vcpkg integrate project
A suitable version of nuget was not found (required v6.2.1) Downloading portable nuget 6.2.1...
Downloading nuget...
https://dist.nuget.org/win-x86-commandline/v6.2.1/nuget.exe->D:\InstallSoftware\vcpkg\downloads\dbb8c13d-nuget.exe
Downloading https://dist.nuget.org/win-x86-commandline/v6.2.1/nuget.exe
Created nupkg: C:\Users\Administrator\vcpkg.D.InstallSoftware.vcpkg.1.0.0.nupkg
With a project open, go to Tools->NuGet Package Manager->Package Manager Console and paste:
Install-Package "vcpkg.D.InstallSoftware.vcpkg" -Source "C:\Users\Administrator"
PS C:\Users\Administrator> vcpkg integrate install
Applied user-wide integration for this vcpkg root.
CMake projects should use: "-DCMAKE_TOOLCHAIN_FILE=D:/InstallSoftware/vcpkg/scripts/buildsystems/vcpkg.cmake"
All MSBuild C++ projects can now #include any installed libraries. Linking will be handled automatically. Installing new libraries will make them instantly available.
PS C:\Users\Administrator>
添加安装的vcpkg包源
打开vs2022 工具 -> NuGet包管理器 -> 程序包管理器设置 -> 程序包源
https://blog.csdn.net/qq_36212935/article/details/130849333
Update url: https://raw.hellogithub.com/hosts
Star me: https://github.com/521xueweihan/GitHub520