TExcelTAD
Home › C/C++ Packages: Conan 2, vcpkg & CPM.cmake › vcpkg: Classic vs Manifest Mode

vcpkg: Classic vs Manifest Mode

vcpkg is Microsoft's open-source C/C++ package manager. Where Conan is a general framework with recipes and remotes, vcpkg is a curated collection: one Git repository holds the tool's scripts and more than 2,500 ports (build recipes), and every port is tested to build together with every other port at each commit. You get a consistent set of libraries instead of choosing versions one by one.

Term Meaning
port a folder ports/<name>/ with vcpkg.json (metadata) and portfile.cmake (how to build)
triplet the target configuration, e.g. x64-linux, x64-windows, arm64-osx (Triplets)
baseline a commit of the vcpkg repository that fixes every port's version (Baselines)
manifest your project's vcpkg.json, listing what it needs
binary cache zip files of built packages, keyed by an ABI hash (Binary Caching)
registry a source of ports; the built-in one is the vcpkg repository itself (Custom Registries)

Getting vcpkg

vcpkg is a Git clone plus a small executable that a bootstrap script downloads:

bash
git clone https://github.com/microsoft/vcpkg.git ~/vcpkg
~/vcpkg/bootstrap-vcpkg.sh          # bootstrap-vcpkg.bat on Windows
export VCPKG_ROOT=~/vcpkg
export PATH="$VCPKG_ROOT:$PATH"

Visual Studio 2022 and newer also ship a copy (in the Developer Command Prompt), and GitHub's hosted runners have one preinstalled. Our container has a clone at /opt/vcpkg, pinned to the 2026.10.16 release tag:

bash · try it yourself
vcpkg version | head -1
echo "VCPKG_ROOT=$VCPKG_ROOT"
ls "$VCPKG_ROOT" | grep -vE '\.(md|txt|yml|nix|bat)
  


ls "$VCPKG_ROOT/ports" | wc -l
vcpkg search spdlog 2>&1 | grep -E '^spdlog'
vcpkg package management program version 2026-09-26-51bf87ca6e9bf3e622d84ff323bd202ab1ca0c0b
VCPKG_ROOT=/opt/vcpkg
bootstrap-vcpkg.sh
docs
downloads
ports
scripts
toolsrc
triplets
vcpkg
vcpkg.disable-metrics
versions
2877
spdlog                   1.17.0#1         Very fast, header-only/compiled, C++ logging library.
spdlog[benchmark]                         Use google benchmark
spdlog[fmt]                               Use fmt library
spdlog[tz-offset]                         Omit %z timezone offset (use on platforms without tm_gmtoff)
spdlog[wchar]                             Build with wchar_t (Windows only)

The vcpkg executable is versioned separately from the ports (the tool's version is a date plus a commit); the ports are whatever the Git checkout contains.

Classic mode

vcpkg's original mode installs packages into one shared tree inside the vcpkg folder, like a system package manager:

bash · try it yourself
vcpkg install fmt 2>&1 | grep -v -e 'package ABI' -e 'Elapsed'
echo "--- vcpkg list"
vcpkg list
ls "$VCPKG_ROOT/installed/x64-linux/lib"
Computing installation plan...
The following packages will be built and installed:
    fmt:x64-linux@12.2.0#1
  * vcpkg-cmake:x64-linux@2025-08-07
  * vcpkg-cmake-config:x64-linux@2026-07-21
Additional packages (*) will be modified to complete this operation.
Detecting compiler hash for triplet x64-linux...
Compiler found: /usr/bin/c++
Restored 3 package(s) from /opt/vcpkg-cache in 22.4 ms. Use --debug to see more details.
Installing 1/3 vcpkg-cmake:x64-linux@2025-08-07...
Installing 2/3 vcpkg-cmake-config:x64-linux@2026-07-21...
Installing 3/3 fmt:x64-linux@12.2.0#1...
Total install time: 7.6 ms
Installed contents are licensed to you by owners. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Packages installed in this vcpkg installation declare the following licenses:
MIT
The package fmt provides CMake targets:

    find_package(fmt CONFIG REQUIRED)
    target_link_libraries(main PRIVATE fmt::fmt)

    # Or use the header-only version
    find_package(fmt CONFIG REQUIRED)
    target_link_libraries(main PRIVATE fmt::fmt-header-only)

All requested installations completed successfully in: 7.6 ms
--- vcpkg list
fmt:x64-linux                                     12.2.0#1            {fmt} is an open-source formatting library provi...
vcpkg-cmake-config:x64-linux                      2026-07-21
vcpkg-cmake:x64-linux                             2025-08-07
libfmt-c.a
libfmt.a
pkgconfig

Two things to notice. vcpkg also installed vcpkg-cmake and vcpkg-cmake-config: they are host tools, helper ports that other portfiles use to build. And it didn't compile anything: the three packages were Restored ... from /opt/vcpkg-cache, the container's binary cache.

Classic mode is simple but has the same problems as system packages: one version per library for every project on the machine, and nothing in your repository says what the project needs.

Manifest mode

In manifest mode, your project has a vcpkg.json and vcpkg installs into a vcpkg_installed/ folder inside the project. Every project gets its own dependencies, and the manifest is committed. This is what the rest of the course uses, and what Microsoft recommends for new projects:

bash · try it yourself
mkdir -p app && cd app
cat > vcpkg.json <<'JSON'
{
  "dependencies": [ "fmt" ],
  "builtin-baseline": "5d4a3dc90c0b3773f3bac81bf41297b54328f471"
}
JSON
vcpkg install 2>&1 | grep -E 'will be built|@|Restored|completed' | grep -v 'package ABI'
ls vcpkg_installed vcpkg_installed/x64-linux
The following packages will be built and installed:
    fmt:x64-linux@12.2.0#1
  * vcpkg-cmake:x64-linux@2025-08-07
  * vcpkg-cmake-config:x64-linux@2026-07-21
Restored 3 package(s) from /opt/vcpkg-cache in 21 ms. Use --debug to see more details.
Installing 1/3 vcpkg-cmake-config:x64-linux@2026-07-21...
Installing 2/3 vcpkg-cmake:x64-linux@2025-08-07...
Installing 3/3 fmt:x64-linux@12.2.0#1...
All requested installations completed successfully in: 8.03 ms
vcpkg_installed:
vcpkg
x64-linux

vcpkg_installed/x64-linux:
debug
include
lib
share

vcpkg install without arguments reads the manifest in the current folder. In manifest mode, vcpkg install fmt is an error: you edit vcpkg.json instead (or let vcpkg add port fmt edit it for you).

Classic mode Manifest mode
Dependencies listed in the command line vcpkg.json in your repository
Installed into $VCPKG_ROOT/installed/ (shared) <project>/vcpkg_installed/ (per project)
Versions whatever the vcpkg checkout has pinned by the baseline, with constraints and overrides
CMake integration toolchain file toolchain file, which also runs vcpkg install
Use for quick experiments real projects

Test yourself

What is a vcpkg port?

  1. A network port vcpkg listens on
  2. A folder with vcpkg.json and portfile.cmake describing how to build one library
  3. A prebuilt binary
  4. A CMake target

Where does manifest mode install packages?

  1. $VCPKG_ROOT/installed
  2. vcpkg_installed/ inside your project
  3. /usr/local
  4. ~/.vcpkg

Why did vcpkg install fmt also install vcpkg-cmake and vcpkg-cmake-config?

  1. They are part of fmt
  2. They are host tool ports that fmt's portfile uses to build and fix up CMake configs
  3. Classic mode always installs them
  4. They are needed at run time