N. P. O'Donnell, 2020, 2021
- Conan website: conan.io
- Search for packages in conan center: conan.io/center
- Documentation: docs.conan.io
Install Conan:
pip install conan
To consume packages, you need to have one or more remote repositories (remotes) configured.
List remotes:
conan remote list
Add a new remote (conan-center
in this example):
conan remote add conan-center https://center.conan.io
Search for a package in conan-center
:
conan search nlohmann_json --remote=conan-center
Inspect the package (prints some metadata):
conan inspect nlohmann_json/3.9.1
All conan packages, whether fetched from a remote, or built locally with conan create
, are cached in the conan cache which is typically located in ~/.conan/data
.
This file goes in the root directory and is divided into sections, each identified by a name enclosed in square brackets.
Dependencies go here.
The tool used to generate the makefiles (or whatever) which eventually build your software. For example CMake.
[requires]
nlohmann_json/3.9.1
[generators]
cmake
To install dependencies, change into the build directory: build
, or cmake-build-debug
for CLion users, and type:
conan install ..
When developing several related packages at the same time, such as aa library and an app which uses the library, it's handy to make the library package editable.
List editable packages:
conan editable list