install conan
sudo apt install python3-pip
pip install conan
looking for library
conan search poco --remote=conancenter
poco/1.8.1 poco/1.9.3 poco/1.9.4
creating a conanfile.txt inside our project’s folder with the following content:
[requires]
poco/1.9.4
[generators]
cmake
Next step: We are going to install the required dependencies and generate the information for the build system:
$ conan profile new default --detect # Generates default profile detecting GCC and sets old ABI
$ conan profile update settings.compiler.libcxx=libstdc++11 default # Sets libcxx to C++11 ABI
$ mkdir build && cd build #create build folder of cmake binary
$ conan install .. #install libraries
#or conan install .. --settings os="Linux" --settings compiler="gcc"
Now let’s create our build file. To inject the Conan information, include the generated conanbuildinfo.cmake file like this:
cmake_minimum_required(VERSION 2.8.12)
project(MD5Encrypter)
add_definitions("-std=c++11")
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
add_executable(md5 md5.cpp)
target_link_libraries(md5 ${CONAN_LIBS})