Difficulty: Beginner
Estimated Time: 10 minutes

Welcome to the basic Conan tutorial.

The goal is to show you a few examples of how Conan works. The tutorial goes alongside the official docs very well, so feel free to get some background information there. The environment this tutorial takes place in let's you play around a lot, it is encouraged to try things out and get a feeling on what's possible.

This tutorial is meant to show experienced C++ programmers how to use the package manager Conan. Knowledge about C++ and CMake are required. It also helps to be familiar with the Linux command line and Python.

You've finished the Conan tutorial, happy compiling!

Conan Basics

Step 1 of 6

Hello Conan

Before we're diving into Conan let's make ourselves familiar with the environment we're working in.

On the right side you see an editor window and a terminal. This is a normal Ubuntu-based system, you can freely navigate through the system and edit files. As you are root-user it's even possible for you to install additional software or reconfigure the system.

All links to files are clickable, so are the terminal commands below.

To get started we've set up a very simple application for you. Within the directory helloworld/source is a very simple hello.cpp that gets built with a standard CMakeLists.txt. To open those files click onto the following links:

  • helloworld/source/hello.cpp
  • helloworld/source/CMakeLists.txt

We want to build the application within the helloworld/build directory by using CMake. Building the app is straight-forward:

  • mkdir -p ~/helloworld/build && cd ~/helloworld/build
  • cmake ../source
  • cmake --build .
  • ./hello

As you can see there is no magic going on...