C++ Package Managers
Conan 2, vcpkg, xrepo, CPM.cmake, and Hunter — compared across package availability, binary caching, CMake integration, and workflow fit.
Quick pick
Comparison matrix
| Feature | vcpkg | Conan 2 | xrepo | CPM.cmake | Hunter |
|---|---|---|---|---|---|
| Packages | 2 400+ | 1 600+ (ConanCenter) | 1 000+ | Any CMake project on GitHub | 500+ |
| Binary cache | Download cache | Per-user | |||
| CMake integration | Native (toolchain file / CMakePresets) | CMakeDeps / CMakeToolchain generators | Via cmake integration | Native — is a CMake module | Native |
| Versioning | Baseline pinning | Semver + lock files | Version pinning | Git tags / commits | SHA pinning |
| Cross-compile | Limited | ||||
| Vendor | Microsoft | JFrog | xmake | Community | Community |
Microsoft's package manager — seamless CMake/MSBuild integration, huge library catalog, manifest mode.
- Largest C++ package catalog
- Zero-config CMake integration
- GitHub Actions & CI binary caching
- Manifest mode for reproducible builds
- Free, open source
Most powerful and flexible — binary packages, profiles, cross-compilation, self-hosted server.
- Pre-built binary packages from ConanCenter
- Powerful profiles (compiler, OS, arch, settings)
- Self-hosted Artifactory server
- Best cross-compilation support
- Python-based conanfile for full flexibility
Bundled with xmake — Lua-configured, supports 1000+ packages, works standalone too.
- Built into xmake — zero extra setup
- Works standalone with CMake/other tools
- Fast source-based builds with caching
- Good Windows support
Single CMake file, zero overhead — wraps FetchContent with caching and version pinning.
- Zero install — just one cmake file
- Works with any CMake project on GitHub
- Download caching
- Simplest possible setup
CMake-only, header-based bootstrap, per-user cache. Older but still used in some projects.
- No external tool needed
- Per-user package cache
- Works in CMake ExternalProject style
Deep-dive guides
"Conan 2 reference: conanfile.py, conanfile.txt, profiles, generators, binary compatibility, and CMake integration."
CPM.cmake for zero-setup C++ dependency management — CPMAddPackage, version pinning, offline mode, and local overrides.
Hunter CMake package manager — setup, using packages, toolchains, binary caching, and comparison with vcpkg and Conan.
Microsoft's C++ package manager — manifest mode, classic mode, CMake integration, triplets, overlays, and binary caching.
xrepo package manager — searching and installing packages, CMake/Meson integration, private repositories, and cross-compilation.