Conan package manager tutorial

A short introduction of Conan package manager concepts and workflow

Kohei Otsuka
Level Up Coding
Published in
7 min readJun 15, 2020

--

https://commons.wikimedia.org/wiki/File:Conan_package_manager_logo.png

When you are developing a library or an executable program, sometimes you are going to use external libraries for your software instead of writing them on your own in order to avoid reinventing the wheels.

Even though this happens no matter which tool you are using to manage the build process, since CMake¹ has become the de facto tool for C/C++ packages, I focus on the topic with CMake.

Classic approaches for resolving dependencies to the external libraries while using CMake is copying the source codes of the external libraries into the subdirectories, then use add_subdirectory() in your CMakeLists.txt to add the external libraries codes to your CMake tree, and build it all together with your software.

The copying is done either by manually downloading the code (often as formats of .zip, tar.gz) from the website or using git submodule² and get it from the git repository or using ExternalProject module³ extension of CMake.

Also, instead of adding the copied external packages to your CMake tree, you can separately build & install the external packages out side of your CMake tree, then use find_package() in the CMakeLists.txt to import them when you build your software (You can…

--

--