本文へ移動
cccskills
無料GitHub で公開

conan-vcpkg

Use when adding C/C++ dependencies with Conan or vcpkg, managing binary compatibility, integrating with CMake via conanfile.txt or vcpkg.json, or choosing between Conan and vcpkg.

インストール方法を見る

含まれるファイル(3)

  • SKILL.md7.1 KB
  • agents/openai.yaml244 B
  • references/package-manager-patterns.md4.1 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Conan and vcpkg

C/C++ dependency management with Conan and vcpkg. Grounded against Conan 2.32.0 and vcpkg 2026.07.29.

Contract

FieldBound contract
TriggerThe task adds a third-party C/C++ library, writes conanfile.txt/conanfile.py or vcpkg.json, integrates a package manager with CMake, manages binary compatibility, or picks between Conan and vcpkg.
AuthorityReversible local: writes only conanfile.*, vcpkg.json, profiles, triplets, overlay ports, and the local package caches; rollback is version control plus clearing the cache. No remote mutation.
Side effectPackage installs download sources or binaries into the local Conan or vcpkg cache; conan upload pushes to a remote and requires an explicit user request.
DoneThe declared dependencies resolve and the project configures and builds against them, or the failing command is reported.

Inputs

  • Dependency list (required): library names; versions come from ConanCenter or the vcpkg registry.
  • Build system (required): CMake integration is assumed below.
  • Platform constraints (optional): cross-compilation target, static vs shared linkage, MSVC vs GCC/Clang.
  • Private remote (optional): an Artifactory or Conan remote URL supplied by the user.

Procedure

  1. Pick the package manager. Done when: one tool is chosen with a stated reason.
SituationPick
MSVC-first Windows teamvcpkg: tighter MSVC and Visual Studio integration
Prebuilt binaries in CI, no source buildsConan: binary package cache and package IDs
Cross-compilation profilesConan: host/build profile split
Exact version pinning per packageConan: explicit version references
Fast setup for a small projectvcpkg manifest mode
Open-source project with broad audiencevcpkg: lower barrier for contributors
  1. Set up vcpkg in manifest mode. Done when: vcpkg.json exists and CMake configures with the vcpkg toolchain file.
git clone https://github.com/microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.sh     # Linux/macOS; .bat on Windows
{
    "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": "<vcpkg commit sha>"
}

Pin builtin-baseline to a vcpkg commit so every build resolves the same package set; get it with git -C /path/to/vcpkg rev-parse HEAD and refresh it with vcpkg x-update-baseline.

cmake -S . -B build \
    -DCMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake --build build
find_package(ZLIB REQUIRED)
find_package(CURL REQUIRED)
find_package(fmt REQUIRED)
target_link_libraries(myapp PRIVATE ZLIB::ZLIB CURL::libcurl fmt::fmt)
  1. Set up Conan 2 with the CMake generators. Done when: conan install produces conan_toolchain.cmake and the project configures against it.
pip install conan
conan profile detect     # writes a default profile for the local compiler
conan profile show       # inspect it
# conanfile.txt; versions are examples, check ConanCenter for current releases
[requires]
zlib/1.3
fmt/10.2.1
openssl/3.2.0

[generators]
CMakeDeps
CMakeToolchain

[options]
openssl/*:shared=False
conan install . --output-folder=build --build=missing
cmake -S . -B build \
    -DCMAKE_TOOLCHAIN_FILE=build/conan_toolchain.cmake \
    -DCMAKE_BUILD_TYPE=Release
cmake --build build
find_package(ZLIB REQUIRED)
find_package(fmt REQUIRED)
find_package(OpenSSL REQUIRED)
target_link_libraries(myapp PRIVATE ZLIB::ZLIB fmt::fmt OpenSSL::SSL OpenSSL::Crypto)
  1. Cross-compile with Conan profiles. The host profile describes the target; the build profile describes the machine running the build. Done when: conan install --profile:host=<target> resolves packages for the target.
# ~/.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++
conan install . \
    --profile:build=default \
    --profile:host=linux-arm64 \
    --output-folder=build-arm \
    --build=missing
  1. Use conanfile.py when logic is needed: conditional requirements, custom generate or build steps. Done when: the recipe's requirements, generate, and build methods cover the project's conditions.
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):
        CMakeToolchain(self).generate()
        CMakeDeps(self).generate()

    def build(self):
        cmake = CMake(self)
        cmake.configure()
        cmake.build()
  1. Map common libraries between the two registries. Done when: each needed library has a name in the chosen registry.
Libraryvcpkg nameConan name
zlibzlibzlib
OpenSSLopensslopenssl
libcurlcurllibcurl
{fmt}fmtfmt
spdlogspdlogspdlog
Boostboostboost
nlohmann-jsonnlohmann-jsonnlohmann_json
GoogleTestgtestgtest
Google Benchmarkbenchmarkbenchmark
SQLitesqlite3sqlite3
protobufprotobufprotobuf

For baseline pinning, triplets, overlay ports, binary caches, and lockfiles see references/package-manager-patterns.md.

Failure and recovery

  • Package not found: check the name against the registry (conan search or vcpkg search); names differ between the two.
  • conan install --build=missing builds from source and fails: read the package build log; a missing system tool or an unsupported setting (compiler.libcxx, arch) is the usual cause.
  • Binary incompatibility (link errors, ABI mismatch): rebuild the package with the project's build_type and compiler settings; Conan package IDs encode these.
  • vcpkg resolves wrong versions: pin builtin-baseline; without it the registry floats.
  • CMake cannot find Conan-generated files: confirm -DCMAKE_TOOLCHAIN_FILE points at the conan_toolchain.cmake under the --output-folder used at install time.
  • conan upload is a remote write: run it only when the user explicitly asks to publish.

Output

A working dependency declaration (conanfile.txt/conanfile.py or vcpkg.json), the matching CMake integration, and a verified configure and build. For selection tasks, the decision table row that applies with its reason.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Use when explaining System V AMD64, ARM AAPCS, RISC-V psABI, stack frames, variadic calls, or FFI register rules. Not for the Rust FFI binding layer: use rust-ffi.

日本語の概要は準備中です。原文の説明を表示しています。

OutlineDriven/odin-claude-plugin372026年9月29日 更新

Use when configuring ADC sampling time, DMA-driven ADC, calibration, or DAC channel setup on bare-metal MCUs. Not for the DMA stream itself: use dma-baremetal.

日本語の概要は準備中です。原文の説明を表示しています。

OutlineDriven/odin-claude-plugin372026年9月29日 更新

af-xdp

無料

Use when creating AF_XDP sockets, configuring UMEM and XSK rings, writing an XDP redirect program, or choosing copy versus zero-copy mode. Not for full kernel bypass: use dpdk.

日本語の概要は準備中です。原文の説明を表示しています。

OutlineDriven/odin-claude-plugin372026年9月29日 更新

Use when a completed session needs an agent-environment retrospective. Not for an engineering retrospective from telemetry: use engineering-retrospective.

日本語の概要は準備中です。原文の説明を表示しています。

OutlineDriven/odin-claude-plugin372026年9月29日 更新

Use when a redacted, trimmed agent transcript must be appended to a GitHub PR or issue body, with human approval and preview. Not for automated or model-initiated insertion.

日本語の概要は準備中です。原文の説明を表示しています。

OutlineDriven/odin-claude-plugin372026年9月29日 更新

agents-md

無料

Use when a repo needs agent setup, AGENTS.md added or made lean, CLAUDE.md audited, or agent instructions scored or pruned. Not for remote, credential, publish, deploy, or irreversible changes.

日本語の概要は準備中です。原文の説明を表示しています。

OutlineDriven/odin-claude-plugin372026年9月29日 更新

OutlineDriven のスキルをすべて見る

このスキルの問題を報告する