Claude-skill-registry conan-basic-usage
Basic operations for the Conan C++ package manager. Use when the user explicitly asks to 'use conan' for tasks like creating projects, installing dependencies, or building packages, or asks for 'how to' guidance on Conan setup.
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/conan-basic-usage" ~/.claude/skills/majiayu000-claude-skill-registry-conan-basic-usage && rm -rf "$T"
skills/data/conan-basic-usage/SKILL.mdConan Basic Usage
Overview
This skill provides guidance on using Conan, the C/C++ package manager. It covers project initialization, dependency management, and package creation.
Quick Start
1. Initialize a Project
To create a standard project structure for a C++ library using CMake:
mkdir myproject && cd myproject conan new cmake_lib -d name=myproject -d version=0.1
This generates:
: The package recipe.conanfile.py
: The build script.CMakeLists.txt
&src/
: Source and header files.include/
: A consumer project to verify the package.test_package/
2. Install Dependencies
To install dependencies defined in
conanfile.py and build missing binaries:
conan install . --build=missing
3. Create/Build Package
To build the package and export it to your local Conan cache:
conan create .
This runs the
build() method in conanfile.py, creates the binary package, and runs the tests in test_package/.
Common Tasks
Managing Dependencies
- Install: Use
to resolve and install dependencies. Addconan install .
to compile from source if binaries aren't available for your configuration.--build=missing - Inspect: Use
to see the dependency tree.conan graph info .
Remote Management
- List Remotes:
conan remote list - Add Remote:
conan remote add <remote_name> <url> - Upload:
conan upload <package_name> -r <remote_name>
Reference
-
Project Structure: Best practices for directory layout. See project-structure.md.
-
Configuration: Core settings, cache location, and profiles. See configuration.md.
-
Runtime & Build Layout: Build directory structure and how to find shared libraries. See runtime-layout.md.
-
Internal Files: Understanding
,conanmanifest.txt
, etc. See internal-files.md.conaninfo.txt -
Commands: Comprehensive list of common commands. See commands.md.