conan Cheatsheet
#
Conan is a package manager for C and C++ that helps manage dependencies, build configurations, and package distribution across various platforms.
Basic Commands
#
Command/Option | Example | Description |
---|
conan install | conan install . | Install dependencies from a conanfile.txt or conanfile.py |
conan create | conan create . user/channel | Create a package from a recipe and upload it to a remote |
conan upload | conan upload pkg/1.0@user/channel --all | Upload a package to a remote repository |
conan remove | conan remove pkg/1.0@user/channel | Remove a package from the local cache |
conan info | conan info . | Display information about the dependencies |
conan search | conan search pkg/1.0@user/channel | Search for a package in remotes |
Package Management
#
Command/Option | Example | Description |
---|
conan list | conan list | List all packages in the local cache |
conan download | conan download pkg/1.0@user/channel | Download a package from a remote repository |
conan export | conan export . user/channel | Export a package recipe to the local cache |
conan upload | conan upload pkg/1.0@user/channel --all | Upload a package to a remote repository |
Configuration
#
Command/Option | Example | Description |
---|
conan config install | conan config install config.json | Install configuration from a file |
conan config install | conan config install config.json | Install configuration from a file |
conan config set | conan config set general.revisions_enabled=True | Set a configuration option |
conan config remove | conan config remove general.revisions_enabled | Remove a configuration option |
Remote Management
#
Command/Option | Example | Description |
---|
conan remote add | conan remote add myremote http://myremote.com | Add a new remote repository |
conan remote list | conan remote list | List all remote repositories |
conan remote remove | conan remote remove myremote | Remove a remote repository |
conan remote update | conan remote update myremote http://newurl.com | Update a remote repository URL |
Profiles
#
Command/Option | Example | Description |
---|
conan profile new | conan profile new myprofile | Create a new profile |
conan profile list | conan profile list | List all profiles |
conan profile show | conan profile show myprofile | Show details of a profile |
conan profile update | conan profile update settings.compiler=gcc myprofile | Update profile settings |
Advanced Commands
#
Command/Option | Example | Description |
---|
conan graph | conan graph info . | Display the dependency graph |
conan package | conan package info pkg/1.0@user/channel | Show package information |
conan build | conan build . | Build a package from a recipe |
This cheatsheet covers essential Conan commands for managing C/C++ packages, including installation, configuration, remote management, and more.