Skip to content

vcpkg

September 29, 2023
May 19, 2023

Open source C/C++ dependency manager from Microsoft

vcpkg - Open source C/C++ dependency manager from Microsoft
vcpkg documentation | Microsoft Learn
microsoft/vcpkg: C++ Library Manager for Windows, Linux, and MacOS

Triplet files | Microsoft Learn environment configs
vcpkg Host Dependencies for Cross-Compilation | C++ Team Blog

# Use 64 bit by default
[Environment]::SetEnvironmentVariable("VCPKG_DEFAULT_TRIPLET", "x64-windows", "Machine")  # persist
$Env:VCPKG_DEFAULT_TRIPLET="x64-windows"  # current shell

# remove all `x86-windows` packages
vcpkg list | % { $_.Split(" ") | Select-Object -first 1 } | Where-Object { $_ -like "*:x86-windows" } | ForEach-Object -Process { vcpkg remove --recurse $_ }

To integrate to CMake, add this line before PROJECT in cmakelist.txt

SET(CMAKE_TOOLCHAIN_FILE "C:/vcpkg/scripts/buildsystems/vcpkg.cmake")

Managing dependencies in a C++ project with vcpkg | Declaration of VAR
Vcpkg: A tool to build open source libraries on Windows
Simple C++ project with CMAKE and VCPKG - YouTube

Package Repo

Browse public vcpkg packages

vcpkg depend-info qtbase:x64-windows

Point Cloud Library is available in Vcpkg – Summary?Blog

Binary Cache

Binary Caching | Microsoft Learn located in %LOCALAPPDATA%\vcpkg\archives
Binary Caching not recognized by other PCs · Issue #27197 · microsoft/vcpkg

Windows long path

Package [qtwebengine] Build Failure · Issue #27927 · microsoft/vcpkg
Sequence issue with --x-packages-root and --x-buildtrees-root · Issue #25016 · microsoft/vcpkg
c++ - set vcpkg x-buildtrees-root option in manifest or in cmakepresets.json - Stack Overflow