SlideShare a Scribd company logo
Meetup C/C++ Floripa
Conan.io
@uilianries
Hello!
Uilian Ries
C++ Developer
Work at Khomp
@uilianries
2
1.
POPULAR C ++
PROJECTS
Because you need good libraries
“
4
BOOST POCO GTEST
ABSEILOPEN CV QT
LIBPNGOPENSSLZLIB
ALL OF THEM NEED TO BE BUILT
▪ Download the source. Build on your machine
▫ It may take several minutes, or even hours
▫ There may be external dependencies
▫ You need to know how to build
▪ Install by system package manager
▫ The version may not be as expected
▫ There may be a patch applied
5
2.
PACKAGE MANAGERS
How to avoid externals in your project
POPULAR PACKAGE MANAGERS
7
8
https://youtu.be/fX2W3nNjJIo?t=41m44s
9
CPPAN BUCKAROO
CGET CPM
HUNTER CONAN
C++ UNIVERSE
3.
CONAN
The Barbarian arrived to save
▪ FOSS
▪ MIT License
▪ Decentralized, GIT style
▪ Handles from source/binaries
▪ Generators for CMake, VS, XCode, qmake …
▪ Developed in Python
▪ +70 contributors
▪ 1K2 stars (Github)
11
12
PIP IS ALL YOU NEED TO INSTALL
4.
CONAN IN ACTION
Talk is cheap. Show me the code.
CONAN IN ACTION
▪ Digest MD5 using Poco project
▪ Check an email address by Boot Regex
▪ Build using CMake
14
15
// example.cpp
#include "Poco/MD5Engine.h"
#include <boost/regex.hpp>
#include <string>
#include <iostream>
int main(){
Poco::MD5Engine md5;
md5.update("Hello World");
std::string md5string = Poco::DigestEngine::digestToHex(md5.digest());
std::cout<< "MD5= " << md5string << "n";
std::string s = "correct@email.com", s2="bademail";
boost::regex expr{"b[a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,4}b"};
std::cout << std::boolalpha << boost::regex_match(s, expr) << 'n';
std::cout << std::boolalpha << boost::regex_match(s2, expr) << 'n';
}
16
# conanfile.txt
[requires]
Poco/1.8.0.1@pocoproject/stable
Boost/1.64.0@conan/stable
[generators]
cmake
17
# CMakeLists.txt
cmake_minimum_required(VERSION 2.8)
project(example CXX)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
add_executable(example example.cpp)
target_link_libraries(example ${CONAN_LIBS})
$ mkdir build && cd build
$ conan install ..
$ cmake ..
$ cmake --build .
$ bin/example
18
HOW TO BUILD
19
RUNNING CONAN
20
class ExampleConan(ConanFile):
name = "example"
version = "0.1.0"
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"
exports_sources = "*"
requires = "Poco/1.8.0.1@pocoproject/stable", "Boost/1.64.0@conan/stable"
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
# Or, using explicit way:
self.run('cmake %s/src %s' % (self.source_folder, cmake.command_line))
self.run("cmake --build . %s" % cmake.build_config)
$ conan create uilian/testing
21
HOW TO BUILD
5.
CONAN IN A
NUTSHELL
How the barbarian works.
UNDERSTANDING THE BARBARIAN
▪ Package naming
▪ System setup
▪ Package distribution
▪ Local cache
23
PACKAGE NAMING
name/version@user/channel
▪ Examples
▫ Poco/1.8.0@lasote/stable
▫ Boost/1.65.1@memsharded/testing
▫ zlib/1.2.11@conan/stable
24
SYSTEM SETUP
▪ Based on profiles
Conan settings + Host configuration = Profile
25
SYSTEM SETUP
26
PACKAGE DISTRIBUTION
▪ Git flavor
▪ Support multiple remotes
▪ Central repository - Bintray
▪ Easy to run a local server instance
▪ Artifactory can be used together
27
PACKAGE DISTRIBUTION
28
conanfile.txt
Conan cache
conan.corp.org:9300
localhost
bintray.com/conan
PACKAGE DISTRIBUTION
29
LOCAL CACHE
▪ Packages are based on:
▫ Settings
▫ Options
▫ Requires
30
LOCAL CACHE
31
Boost/1.64.0@bincrafters/stable
Package_ID: b2a2dd150fed04abc97d11c09f340db88855c686
[options]
shared: True
[settings]
arch: x86_64
build_type: Release
compiler: gcc
compiler.libcxx: libstdc++
compiler.version: 6.3
os: Linux
[requires]
Boost.Core/1.64.0@bincrafters/stable:5ab84d6acfe1f23
LOCAL CACHE
32
Conan package =1 recipe, N binary packages
localhost
conanfile.txt
amd64
Boost/1.64.0@bincrafters/stable
configN
i386
LOCAL CACHE
33
6.
BONUS
How a recipe looks like.
from conans import ConanFile, CMake
class HelloConan(ConanFile):
name = "Hello"
version = "0.1"
settings = "os", "compiler", "build_type", "arch"
options = {"shared": [True, False]}
default_options = "shared=False"
exports_sources = "src/*"
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
def package(self):
self.copy("*.h", dst="include", src="src")
self.copy("*.so", dst="lib", keep_path=False)
self.copy("*.a", dst="lib", keep_path=False)
def package_info(self):
self.cpp_info.libs = ["hello"]
CONAN CREATE
7.
COMMUNITY
Sharing data is the first step toward
community.
BINTRAY AS DOWNLOAD CENTER
▪ JFrog’s solution
▪ Conan Transit: 936 recipes
▪ Conan Center: 21 recipes
38
39
BINCRAFTERS
▪ https://github.com/bincrafters/community
▪ Packaging OSS Software
▪ ~20 members and growing
▪ +200 recipes, including:
▫ Modular Boost, Abseil, Azure, ...
▪ Thanks to @solvingj
40
REFERENCES
▪ https://github.com/conan-io/conan
▪ https://github.com/bincrafters
▪ https://conan.io
▪ https://docs.conan.io
▪ https://github.com/memsharded/four-c-example
▪ CppCon 2016: Conan, a C and C++ package manager for developers
▪ https://bintray.com/conan
▪ Programming C++ With The 4 Cs: Clang, Cmake, Clion And Conan
41
THANKS!
Questions ?
You can find me on:
@uilianries - twitter, github
cpplang.slack.com - channel #conan or #bincrafters
uilianries@gmail.com
42

More Related Content

PDF
Conan a C/C++ Package Manager
PDF
Conan.io - The C/C++ package manager for Developers
PDF
Gitlab - Creating C++ applications with Gitlab CI
PDF
Git, CMake, Conan - How to ship and reuse our C++ projects?
PDF
Using docker to develop NAS applications
PDF
Drone CI/CD 自動化測試及部署
PDF
Intro to vagrant
PDF
Docker deploy
Conan a C/C++ Package Manager
Conan.io - The C/C++ package manager for Developers
Gitlab - Creating C++ applications with Gitlab CI
Git, CMake, Conan - How to ship and reuse our C++ projects?
Using docker to develop NAS applications
Drone CI/CD 自動化測試及部署
Intro to vagrant
Docker deploy

What's hot (20)

PPTX
PHP on Heroku: Deploying and Scaling Apps in the Cloud
PDF
Docker e postgresql
PDF
Drone 1.0 Feature
PDF
Docker command
PDF
Developing and Deploying PHP with Docker
PDF
當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)
PDF
Vagrant for Virtualized Development
PDF
Drone CI/CD Platform
PPTX
Composer | PHP Dependency Manager
PDF
Docker perl build
PPTX
PHP development with Docker
PDF
TDC2018SP | Trilha Containers - CI/CD com Docker e Drone
PDF
Docker 初探,實驗室中的運貨鯨
PDF
Iniciando com Docker
PDF
Puppet and Vagrant in development
PPTX
Vagrant introduction for Developers
PPT
Python virtualenv & pip in 90 minutes
PPTX
How To Set a Vagrant Development System
PDF
DCSF19 Tips and Tricks of the Docker Captains
PPTX
Docker workshop DevOpsDays Amsterdam 2014
PHP on Heroku: Deploying and Scaling Apps in the Cloud
Docker e postgresql
Drone 1.0 Feature
Docker command
Developing and Deploying PHP with Docker
當專案漸趕,當遷移也不再那麼難 (Ship Your Projects with Docker EcoSystem)
Vagrant for Virtualized Development
Drone CI/CD Platform
Composer | PHP Dependency Manager
Docker perl build
PHP development with Docker
TDC2018SP | Trilha Containers - CI/CD com Docker e Drone
Docker 初探,實驗室中的運貨鯨
Iniciando com Docker
Puppet and Vagrant in development
Vagrant introduction for Developers
Python virtualenv & pip in 90 minutes
How To Set a Vagrant Development System
DCSF19 Tips and Tricks of the Docker Captains
Docker workshop DevOpsDays Amsterdam 2014
Ad

Similar to Meetup C++ Floripa - Conan.io (20)

PDF
[FOSDEM2023] Bit-for-bit reproducible builds with Dockerfile
PDF
Hitchhikers guide to open stack toolchains
PDF
Introduction to Kalabox
PDF
Dependencies Managers in C/C++. Using stdcpp 2014
PDF
Leveraging Docker for Hadoop build automation and Big Data stack provisioning
PDF
Leveraging docker for hadoop build automation and big data stack provisioning
PDF
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
PPTX
Real World Experience of Running Docker in Development and Production
PPTX
Docker San Francisco Meetup April 2015 - The Docker Orchestration Ecosystem o...
PDF
Perspectives on Docker
PDF
Capistrano
PDF
Streamline your development environment with docker
PDF
Docker as an every day work tool
PDF
Continuous Integration/Deployment with Docker and Jenkins
PPTX
Scaling Development Environments with Docker
PPTX
Building a production-ready, fully-scalable Docker Swarm using Terraform & Pa...
PPTX
Pp docker-swarm-doxlon-28th-march-2017
PDF
Testing Your Automation Code (Vagrant Version)
PDF
CommandBox at CFCamp 2014
PDF
The origin: Init (compact version)
[FOSDEM2023] Bit-for-bit reproducible builds with Dockerfile
Hitchhikers guide to open stack toolchains
Introduction to Kalabox
Dependencies Managers in C/C++. Using stdcpp 2014
Leveraging Docker for Hadoop build automation and Big Data stack provisioning
Leveraging docker for hadoop build automation and big data stack provisioning
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
Real World Experience of Running Docker in Development and Production
Docker San Francisco Meetup April 2015 - The Docker Orchestration Ecosystem o...
Perspectives on Docker
Capistrano
Streamline your development environment with docker
Docker as an every day work tool
Continuous Integration/Deployment with Docker and Jenkins
Scaling Development Environments with Docker
Building a production-ready, fully-scalable Docker Swarm using Terraform & Pa...
Pp docker-swarm-doxlon-28th-march-2017
Testing Your Automation Code (Vagrant Version)
CommandBox at CFCamp 2014
The origin: Init (compact version)
Ad

More from Uilian Ries (8)

PDF
Git Workflow
PDF
BDD em Ação
PDF
Poco Bibliotecas C++
PDF
Software Development Tools for C/C++
PDF
Testes Unitários com GTest e Catch
PDF
SECCOM 2017 - Conan.io o gerente de pacote para C e C++
PPTX
Elements of C++11
PPT
Unisinos - Proposta TCC 2015
Git Workflow
BDD em Ação
Poco Bibliotecas C++
Software Development Tools for C/C++
Testes Unitários com GTest e Catch
SECCOM 2017 - Conan.io o gerente de pacote para C e C++
Elements of C++11
Unisinos - Proposta TCC 2015

Recently uploaded (20)

PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Encapsulation theory and applications.pdf
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPT
Teaching material agriculture food technology
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Machine learning based COVID-19 study performance prediction
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
cuic standard and advanced reporting.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Understanding_Digital_Forensics_Presentation.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
The Rise and Fall of 3GPP – Time for a Sabbatical?
Encapsulation theory and applications.pdf
Spectral efficient network and resource selection model in 5G networks
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Teaching material agriculture food technology
Building Integrated photovoltaic BIPV_UPV.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Machine learning based COVID-19 study performance prediction
Reach Out and Touch Someone: Haptics and Empathic Computing
Network Security Unit 5.pdf for BCA BBA.
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Review of recent advances in non-invasive hemoglobin estimation
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
cuic standard and advanced reporting.pdf
Encapsulation_ Review paper, used for researhc scholars
Understanding_Digital_Forensics_Presentation.pptx

Meetup C++ Floripa - Conan.io