conan
C/C++ package manager for all platforms
TLDR
Install dependencies from conanfile
SYNOPSIS
conan command [options] [arguments]
DESCRIPTION
conan is a modern, decentralized package manager designed specifically for C and C++ projects, addressing the historically fragmented dependency management landscape in these languages. Unlike language-specific package managers that assume a single build system, Conan integrates with CMake, MSBuild, Meson, Autotools, and custom build systems, making it genuinely cross-platform across Windows, Linux, macOS, and embedded systems.
The tool operates on a binary package model where packages can be precompiled for specific configurations (compiler, OS, architecture, build type) and cached for reuse, dramatically speeding up build times compared to source-only approaches. Conan profiles define these build configurations, and the package manager performs sophisticated dependency resolution that accounts for binary compatibility across the entire dependency graph.
Conan uses a decentralized repository model similar to Git, where teams can host private Conan servers (Artifactory, ConanCenter) while still accessing the public ConanCenter repository. Package recipes (conanfile.py) are written in Python, providing full programmability for complex build scenarios. Conan 2.x represents a major evolution with improved versioning, better CMake integration, and a cleaner CLI, though it introduces breaking changes from the 1.x series.
PARAMETERS
-pr, --profile name
Build profile to use-r, --remote name
Remote repository-of, --output-folder path
Output folder-b, --build policy
Build policy (missing, never, always)-s setting=value
Override setting-o option=value
Override option
CONFIGURATION
conanfile.txt
Simple text format for declaring dependencies.conanfile.py
Python-based package recipe with full control.~/.conan2/profiles/
Build profiles defining compiler, OS, architecture settings.~/.conan2/global.conf
Global configuration for Conan behavior.
COMMANDS
install
Install dependencies from conanfilecreate
Build and create package from recipebuild
Build package locallysearch
Search for packageslist
List packages in cacheremote
Manage remote repositoriesupload
Upload packages to remotedownload
Download packagesexport
Export recipe to cacheprofile
Manage build profilesconfig
Manage Conan configurationnew
Create new package template
CAVEATS
Conan 2.x is current; Conan 1.x is legacy. Binary compatibility configurable. Integrates with CMake, MSBuild, Meson, and custom build systems.
