Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

CONAN CHEAT SHEET

Show Local Client Configuration Search Packages Create a package


Search for packages in a remote
Conan application configuration Create a recipe (conanfile.py) from templates
$ conan config get $ conan search zlib -r conan-center $ conan new <reference> -m <template>

Contents of a profile (eg. default) Consume Packages Just export the recipe to local cache
$ conan profile show default Install package using just a reference $ conan export <path_to_conanfile>
$ conan install <package_reference> Create package from recipe for one configuration
Remote Repositories
Also implicitly does install and export steps
$ conan remote list Install list of packages from conanfile
$ conan create . -pr <profile>
$ cat conanfile.txt
Add and modify configurations [requires]
Upload a Package
zlib/1.2.11
Install collection of configs One or more with wildcard support, with binaries
$ conan install <path_to_conanfile>
$ conan config install <url>
$ conan upload zlib* -r remote --all

Change a single config value Consume packages in build system via generators
Copy packaged files out of Conan cache
$ conan config set general.revisions_enabled=1 $ cat conanfile.txt Using the deploy generator
[requires]
Add a remote zlib/1.2.11 $ conan install zlib/1.2.11@ -g deploy
$ conan remote add my_remote <url> [generators]
cmake_find_package
Provide credentials for remote
$ conan user -p <password> -r my_remote <username>
msbuild
make
Conan Recipe Methods in Package Creation
Display information from recipes or references Install requirements and generate files

Displays attributes of conanfile.py $ mkdir build && cd build package_info()


$ conan install ..
$ conan inspect <path> -a <attribute>
From all dependency recipes
Displays content of conanfile.py for a reference Run your build system (one of the following)
$ conan get <reference> $ cmake .. && cmake --build .
Display dependency graph info for a recipe $ msbuild myproject.sln
exports
$ make exports_sources generate() build() package()
$ conan info <path_or_reference> source()

You might also like