Conan Documentation Release 1.4.5
Total Page:16
File Type:pdf, Size:1020Kb
conan Documentation Release 1.4.5 conan Sep 24, 2021 CONTENTS 1 Upgrading to conan 1.0 3 1.1 Command line changes..........................................3 1.2 Deprecations/removals..........................................3 1.3 Settings and profiles. Gcc/CLang versioning..............................4 1.4 New features...............................................4 2 Introduction 5 2.1 Open Source...............................................5 2.2 Decentralized package manager.....................................5 2.3 Binary management...........................................6 2.4 Cross platform, build system agnostic..................................6 2.5 Stable...................................................7 3 Install 9 3.1 Install with pip (recommended).....................................9 3.2 Install from brew (OSX)......................................... 10 3.3 Install from AUR (Arch Linux)..................................... 10 3.4 Install the binaries............................................ 10 3.5 Initial configuration........................................... 10 3.6 Install from source............................................ 11 4 Getting started 13 4.1 A Timer using POCO libraries...................................... 13 4.2 Installing dependencies......................................... 14 4.3 Building the timer example....................................... 16 4.4 Inspecting dependencies......................................... 16 4.5 Searching packages........................................... 17 4.6 Building with other configurations.................................... 17 5 Using packages 19 5.1 Installing dependencies......................................... 19 5.2 Using profiles............................................... 23 5.3 Workflows................................................ 25 6 Creating packages 29 6.1 Getting started.............................................. 29 6.2 Recipe and sources in a different repo.................................. 33 6.3 Recipe and sources in the same repo................................... 34 6.4 Packaging existing binaries....................................... 36 6.5 Understanding packaging........................................ 38 6.6 Define package ABI compatibility.................................... 40 i 6.7 Inspecting packages........................................... 46 6.8 Packaging approaches.......................................... 46 6.9 Tools for package creators........................................ 51 7 Uploading packages 53 7.1 Remotes................................................. 53 7.2 Uploading packages to remotes..................................... 54 7.3 Using Bintray............................................... 55 7.4 Artifactory Community Edition for C/C++............................... 59 7.5 Running conan_server.......................................... 61 8 Developing packages 67 8.1 Package development flow........................................ 67 8.2 Workspaces [experimental]....................................... 71 9 Package apps and devtools 75 9.1 Running and deploying packages.................................... 75 9.2 Creating conan packages to install dev tools............................... 78 9.3 Build requirements............................................ 82 10 Mastering conan 87 10.1 Use conanfile.py for consumers..................................... 87 10.2 Conditional settings, options and requirements............................. 89 10.3 Version ranges.............................................. 90 10.4 Build policies............................................... 91 10.5 Environment variables.......................................... 92 10.6 Virtual Environments........................................... 93 10.7 Logging.................................................. 95 10.8 Sharing the settings and other configuration............................... 97 10.9 Conan local cache: concurrency, Continuous Integration, isolation................... 98 11 Systems and cross building 101 11.1 Cross building.............................................. 101 11.2 Windows Subsystems.......................................... 108 12 Integrations 113 12.1 CMake.................................................. 113 12.2 Autotools: configure/make........................................ 122 12.3 Visual Studio............................................... 122 12.4 Apple/Xcode............................................... 125 12.5 Compilers on command line....................................... 127 12.6 Android Studio.............................................. 129 12.7 CLion................................................... 134 12.8 Ninja, NMake, Borland......................................... 139 12.9 pkg-config and pc files.......................................... 139 12.10 Boost Build................................................ 143 12.11 QMake.................................................. 143 12.12 Premake................................................. 144 12.13 qbs.................................................... 144 12.14 Meson Build............................................... 145 12.15 Docker.................................................. 146 12.16 Git.................................................... 146 12.17 Jenkins.................................................. 146 12.18 Travis Ci................................................. 149 12.19 Appveyor................................................. 151 ii 12.20 Gitlab................................................... 153 12.21 Circle CI................................................. 154 12.22 YouCompleteMe (vim).......................................... 156 12.23 SCons................................................... 156 12.24 Custom integrations........................................... 157 13 Howtos 163 13.1 How to package header-only libraries.................................. 163 13.2 How to launch conan install from cmake................................ 165 13.3 How to create and reuse packages based on Visual Studio....................... 166 13.4 Creating and reusing packages based on Makefiles........................... 169 13.5 How to manage the GCC >= 5 ABI................................... 171 13.6 Using Visual Studio 2017 - CMake integration............................. 172 13.7 How to manage C++ standard...................................... 175 13.8 How to use docker to create and cross build C and C++ conan packages................ 176 13.9 How to reuse Python code in recipes................................... 179 13.10 How to create and share a custom generator with generator packages................. 182 13.11 How to manage shared libraries..................................... 185 13.12 How to reuse cmake install for package() method............................ 191 13.13 How to collaborate on other users’ packages.............................. 191 13.14 How to link with Apple Frameworks.................................. 192 13.15 How to collect licenses of dependencies................................. 193 13.16 How to capture package version from text or build files......................... 193 13.17 How to use Conan as other language package manager......................... 194 13.18 How to manage SSL (TLS) certificates................................. 199 13.19 How to check the version of the Conan client inside a conanfile.................... 200 13.20 Use a generic CI with Conan and Artifactory.............................. 201 14 Reference 203 14.1 Commands................................................ 203 14.2 conanfile.txt............................................... 245 14.3 conanfile.py............................................... 247 14.4 Generators................................................ 272 14.5 Profiles.................................................. 288 14.6 Build helpers............................................... 292 14.7 Tools................................................... 308 14.8 Configuration files............................................ 327 14.9 Environment variables.......................................... 332 15 Videos and links 341 16 FAQ 343 16.1 General.................................................. 343 16.2 Using conan............................................... 344 16.3 Troubleshooting............................................. 346 17 Changelog 349 17.1 1.4.5 (22-June-2018)........................................... 349 17.2 1.4.4 (11-June-2018)........................................... 349 17.3 1.4.3 (6-June-2018)........................................... 349 17.4 1.4.2 (4-June-2018)........................................... 349 17.5 1.4.1 (31-May-2018)........................................... 349 17.6 1.4.0 (30-May-2018)........................................... 350 17.7 1.3.3 (10-May-2018)........................................... 351 17.8 1.3.2 (7-May-2018)........................................... 351 iii 17.9 1.3.1 (3-May-2018)........................................... 351 17.10 1.3.0 (30-April-2018).......................................... 351 17.11 1.2.3 (10-Apr-2017)........................................... 352 17.12 1.2.1 (3-Apr-2018)............................................ 352 17.13 1.2.0 (28-Mar-2018)........................................... 352 17.14 1.1.1 (5-Mar-2018)............................................ 354 17.15 1.1.0 (27-Feb-2018)........................................... 354 17.16 1.0.4 (30-January-2018)........................................