
Conan Vcpkg
- 365 installs
- 155 repo stars
- Updated June 27, 2026
- mohitmishra786/low-level-dev-skills
Configure Conan or vcpkg to fetch, version, and link C and C++ dependencies reproducibly across local dev, CI, and cross-platform native builds.
About
The conan-vcpkg skill from mohitmishra786/low-level-dev-skills teaches agents to manage C and C++ dependencies with Conan or vcpkg, covering manifests, toolchains, and CI-friendly integration so native CLI, API, and game backends build reliably across environments.
- Compares Conan and vcpkg workflows for C++ projects
- Covers reproducible dependency manifests and lockfiles
- Supports cross-platform native build integration
- Reduces linker and version skew issues in CI pipelines
Conan Vcpkg by the numbers
- 365 all-time installs (skills.sh)
- +25 installs in the week ending Aug 4, 2026 (Skillselion tracking)
- Ranked #315 of 1,435 DevOps & CI/CD skills by installs in the Skillselion catalog
- Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/mohitmishra786/low-level-dev-skills --skill conan-vcpkgAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 365 |
|---|---|
| repo stars | ★ 155 |
| Last updated | June 27, 2026 |
| Repository | mohitmishra786/low-level-dev-skills ↗ |
What it does
Configure Conan or vcpkg to fetch, version, and link C and C++ dependencies reproducibly across local dev, CI, and cross-platform native builds.
Files
Conan and vcpkg
Purpose
Guide agents through C/C++ dependency management with Conan and vcpkg: declaring dependencies, integrating with CMake, managing binary compatibility, and choosing the right tool for a given project.
Triggers
- "How do I add a C++ library dependency with Conan?"
- "How do I use vcpkg with CMake?"
- "What's the difference between Conan and vcpkg?"
- "How do I add zlib/openssl/fmt with a package manager?"
- "How do I create a vcpkg.json manifest?"
- "My Conan package build is failing — how do I debug it?"
Workflow
1. Conan vs vcpkg decision
Which package manager?
├── Team uses MSVC on Windows primarily → vcpkg (better MSVC integration)
├── Need binary packages (no source builds in CI) → Conan (binary cache)
├── Need cross-compilation support → Conan (profiles) or Zig-based builds
├── Need a specific version of a package → Conan (flexible versioning)
├── Quick project setup, just need it to work → vcpkg (simpler)
└── Open-source project, broad audience → vcpkg (GitHub-integrated)2. vcpkg setup
# Clone vcpkg
git clone https://github.com/microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.sh # Linux/macOS
./vcpkg/bootstrap-vcpkg.bat # Windows
# Install packages (classic mode)
./vcpkg/vcpkg install zlib curl openssl
# Integrate with CMake
cmake -S . -B build \
-DCMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake3. vcpkg manifest mode (recommended)
// vcpkg.json — place at project root
{
"name": "myapp",
"version": "1.0.0",
"dependencies": [
"zlib",
"curl",
{ "name": "openssl", "version>=": "3.0.0" },
{ "name": "boost-filesystem", "platform": "!windows" },
{
"name": "fmt",
"features": ["core"]
}
],
"builtin-baseline": "abc123..."
}# CMakeLists.txt
cmake_minimum_required(VERSION 3.20)
project(myapp)
find_package(ZLIB REQUIRED)
find_package(CURL REQUIRED)
find_package(fmt REQUIRED)
add_executable(myapp src/main.cpp)
target_link_libraries(myapp PRIVATE ZLIB::ZLIB CURL::libcurl fmt::fmt)# Build — vcpkg automatically installs dependencies
cmake -S . -B build \
-DCMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake --build build4. Conan setup
# Install Conan
pip install conan
# Set up default profile (detects compiler, OS)
conan profile detect
# Check your profile
conan profile show5. Conan with CMake (Conan 2.x)
# conanfile.txt
[requires]
zlib/1.3
fmt/10.2.1
openssl/3.2.0
[generators]
CMakeDeps
CMakeToolchain
[options]
openssl/*:shared=False# Install dependencies
conan install . --output-folder=build --build=missing
# Configure and build
cmake -S . -B build \
-DCMAKE_TOOLCHAIN_FILE=build/conan_toolchain.cmake \
-DCMAKE_BUILD_TYPE=Release
cmake --build build# CMakeLists.txt
find_package(ZLIB REQUIRED)
find_package(fmt REQUIRED)
find_package(OpenSSL REQUIRED)
add_executable(myapp src/main.cpp)
target_link_libraries(myapp PRIVATE
ZLIB::ZLIB
fmt::fmt
OpenSSL::SSL OpenSSL::Crypto
)6. Conan profiles for cross-compilation
# ~/.conan2/profiles/linux-arm64
[settings]
os=Linux
arch=armv8
compiler=gcc
compiler.version=12
compiler.libcxx=libstdc++11
build_type=Release
[buildenv]
CC=aarch64-linux-gnu-gcc
CXX=aarch64-linux-gnu-g++
[tool_requires]
# Tools that run on build machine (x86)# Cross-compile
conan install . \
--profile:build=default \
--profile:host=linux-arm64 \
--output-folder=build-arm \
--build=missing7. conanfile.py (advanced)
# conanfile.py
from conan import ConanFile
from conan.tools.cmake import CMakeToolchain, CMakeDeps, CMake
class MyAppConan(ConanFile):
name = "myapp"
version = "1.0"
settings = "os", "compiler", "build_type", "arch"
def requirements(self):
self.requires("zlib/1.3")
self.requires("fmt/10.2.1")
if self.settings.os == "Linux":
self.requires("openssl/3.2.0")
def generate(self):
tc = CMakeToolchain(self)
tc.generate()
deps = CMakeDeps(self)
deps.generate()
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()8. Common dependency lookup
| Library | vcpkg name | Conan name |
|---|---|---|
| zlib | zlib | zlib/1.3 |
| OpenSSL | openssl | openssl/3.2.0 |
| libcurl | curl | libcurl/8.4.0 |
| {fmt} | fmt | fmt/10.2.1 |
| spdlog | spdlog | spdlog/1.12.0 |
| Boost | boost | boost/1.83.0 |
| nlohmann-json | nlohmann-json | nlohmann_json/3.11.3 |
| googletest | gtest | gtest/1.14.0 |
| Google Benchmark | benchmark | benchmark/1.8.3 |
| SQLite | sqlite3 | sqlite3/3.44.0 |
| protobuf | protobuf | protobuf/4.25.1 |
For vcpkg baseline pinning and Conan binary cache setup, see references/package-manager-patterns.md.
Related skills
- Use
skills/build-systems/cmakefor CMake integration with both Conan and vcpkg - Use
skills/compilers/cross-gccfor cross-compilation with Conan profiles - Use
skills/build-systems/ninjaas the backend for package-managed projects
Conan and vcpkg Patterns Reference
vcpkg Baseline Pinning
A baseline pins all packages to a specific vcpkg commit:
// vcpkg.json with baseline
{
"name": "myapp",
"version": "1.0.0",
"builtin-baseline": "e79c0d2b5d72eb3063cf32a1f7de1a3e8f6b5d3a",
"dependencies": [
"zlib",
"fmt",
{ "name": "openssl", "version>=": "3.0.0" }
]
}# Find current baseline
git -C /path/to/vcpkg rev-parse HEAD
# Update baseline
vcpkg x-update-baselinevcpkg Feature Flags
// Opt into specific features
{
"dependencies": [
{
"name": "boost",
"features": ["filesystem", "program_options", "regex"]
},
{
"name": "openssl",
"default-features": false,
"features": ["ssl", "crypto"]
}
]
}vcpkg Custom Triplets
# Custom triplet file: triplets/x64-linux-release.cmake
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE static)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CMAKE_SYSTEM_NAME Linux)
set(VCPKG_BUILD_TYPE release) # Only release, no debug# Use custom triplet
cmake -S . -B build \
-DCMAKE_TOOLCHAIN_FILE=/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DVCPKG_TARGET_TRIPLET=x64-linux-release \
-DVCPKG_OVERLAY_TRIPLETS=triplets/vcpkg in CI (GitHub Actions)
- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: 'e79c0d2...' # Pin commit
- name: Configure
run: |
cmake -S . -B build \
-DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake \
-DCMAKE_BUILD_TYPE=Release
- name: Build
run: cmake --build build -j$(nproc)Conan Binary Cache
# Set up Conan Center (default remote)
conan remote list
# Add Artifactory remote (enterprise)
conan remote add mycompany https://artifactory.company.com/artifactory/api/conan/conan-local
# Upload built packages
conan upload "*" --remote mycompany --confirm
# Download pre-built packages (no --build=missing needed)
conan install . --remote mycompanyConan Lockfile (Reproducible Builds)
# Generate lockfile
conan lock create . --build=missing
# Use lockfile for reproducible builds
conan install . --lockfile=conan.lock
# Update lockfile after dependency change
conan lock update conan.lockMixing Conan and Non-Conan Dependencies
# CMakeLists.txt
# Conan-managed
find_package(fmt REQUIRED)
find_package(OpenSSL REQUIRED)
# System-provided (not in Conan)
find_package(Threads REQUIRED)
find_package(X11)
# Vendored (in-tree)
add_subdirectory(third_party/myhdr)vcpkg Overlay Ports (Custom Packages)
my-project/
├── vcpkg.json
└── ports/
└── mylib/
├── vcpkg.json
├── portfile.cmake
└── usage# portfile.cmake
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO myorg/mylib
REF v1.2.3
SHA512 abc...
HEAD_REF main
)
vcpkg_cmake_configure(SOURCE_PATH "${SOURCE_PATH}")
vcpkg_cmake_install()
vcpkg_cmake_config_fixup()
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")# Use overlay port
cmake -S . -B build \
-DCMAKE_TOOLCHAIN_FILE=/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DVCPKG_OVERLAY_PORTS=ports/Conan for Private Packages
# conanfile.py for your own library
class MyLibConan(ConanFile):
name = "mylib"
version = "1.0.0"
exports_sources = "src/*", "include/*", "CMakeLists.txt"
def layout(self):
cmake_layout(self)
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
def package(self):
cmake = CMake(self)
cmake.install()
def package_info(self):
self.cpp_info.libs = ["mylib"]# Build and export to local cache
conan create . --build=missing
# Then use in other projects
# conanfile.txt:
# [requires]
# mylib/1.0.0