The recipe generates library packages, which can be found at Bintray.
The package is usually consumed using the conan install
command or a conanfile.txt.
-
Add remote to conan's package registry.txt:
$ conan remote add sintef https://api.bintray.com/conan/sintef-ocean/conan
-
Using conanfile.txt in your project with cmake
Add a conanfile.txt to your project. This file describes dependencies and your configuration of choice, e.g.:
[requires] tinyxml/[>=2.4.2]@sintef/stable [options] tinyxml:shared=False # by default [imports] licenses, * -> ./licenses @ folder=True [generators] cmake_paths cmake_find_package
Insert into your CMakeLists.txt something like the following lines:
cmake_minimum_required(VERSION 3.13) project(TheProject CXX) include(${CMAKE_BINARY_DIR}/conan_paths.cmake) find_package(tinyxml MODULE REQUIRED) add_executable(the_executor code.cpp) target_link_libraries(the_executor TinyXML::TinyXML)
Then, do
$ mkdir build && cd build $ conan install .. -b missing -s build_type=<build_type>
where
<build_type>
is e.g.Debug
orRelease
. You can now continue with the usual dance with cmake commands for configuration and compilation. For details on how to use conan, please consult Conan.io docs
Option | Allowed values | Default value |
---|---|---|
use_stl | True, False | True |
fPIC | True, False | True |
None