Conan Documentation Release 1.6.1
Total Page:16
File Type:pdf, Size:1020Kb
conan Documentation Release 1.6.1 conan Sep 24, 2021 CONTENTS 1 Introduction 3 1.1 Open Source...............................................3 1.2 Decentralized package manager.....................................3 1.3 Binary management...........................................4 1.4 Cross platform, build system agnostic..................................4 1.5 Stable...................................................5 2 Install 7 2.1 Install with pip (recommended).....................................7 2.2 Install from brew (OSX).........................................8 2.3 Install from AUR (Arch Linux).....................................8 2.4 Install the binaries............................................8 2.5 Initial configuration...........................................8 2.6 Install from source............................................9 2.7 Python 2 Deprecation Notice.......................................9 3 Getting started 11 3.1 A Timer using POCO libraries...................................... 11 3.2 Installing dependencies......................................... 12 3.3 Building the timer example....................................... 14 3.4 Inspecting dependencies......................................... 14 3.5 Searching packages........................................... 15 3.6 Building with other configurations.................................... 15 4 Using packages 17 4.1 Installing dependencies......................................... 17 4.2 Using profiles............................................... 21 4.3 Workflows................................................ 23 5 Creating packages 27 5.1 Getting started.............................................. 27 5.2 Recipe and sources in a different repo.................................. 31 5.3 Recipe and sources in the same repo................................... 32 5.4 Packaging existing binaries....................................... 34 5.5 Understanding packaging........................................ 36 5.6 Define package ABI compatibility.................................... 38 5.7 Inspecting packages........................................... 45 5.8 Packaging approaches.......................................... 45 5.9 Tools for package creators........................................ 50 6 Uploading packages 53 i 6.1 Remotes................................................. 53 6.2 Uploading packages to remotes..................................... 54 6.3 Using Bintray............................................... 55 6.4 Artifactory Community Edition for C/C++............................... 59 6.5 Running conan_server.......................................... 61 7 Developing packages 67 7.1 Package development flow........................................ 67 7.2 Workspaces [experimental]....................................... 71 8 Package apps and devtools 75 8.1 Running and deploying packages.................................... 75 8.2 Creating conan packages to install dev tools............................... 78 8.3 Build requirements............................................ 81 9 Mastering conan 87 9.1 Use conanfile.py for consumers..................................... 87 9.2 Conditional settings, options and requirements............................. 89 9.3 Version ranges.............................................. 90 9.4 Build policies............................................... 91 9.5 Environment variables.......................................... 92 9.6 Virtual Environments........................................... 93 9.7 Logging.................................................. 95 9.8 Sharing the settings and other configuration............................... 97 9.9 Conan local cache: concurrency, Continuous Integration, isolation................... 98 10 Systems and cross building 101 10.1 Cross building.............................................. 101 10.2 Windows Subsystems.......................................... 109 11 Integrations 113 11.1 CMake.................................................. 113 11.2 Autotools: configure/make........................................ 122 11.3 Visual Studio............................................... 122 11.4 Apple/Xcode............................................... 125 11.5 Compilers on command line....................................... 127 11.6 Android Studio.............................................. 129 11.7 CLion................................................... 134 11.8 Ninja, NMake, Borland......................................... 139 11.9 pkg-config and pc files.......................................... 139 11.10 Boost Build................................................ 143 11.11 QMake.................................................. 143 11.12 Premake................................................. 144 11.13 qbs.................................................... 144 11.14 Meson Build............................................... 145 11.15 Docker.................................................. 146 11.16 Git.................................................... 146 11.17 Jenkins.................................................. 146 11.18 Travis Ci................................................. 149 11.19 Appveyor................................................. 151 11.20 Gitlab................................................... 153 11.21 Circle CI................................................. 154 11.22 YouCompleteMe (vim).......................................... 156 11.23 SCons................................................... 156 11.24 Custom integrations........................................... 157 ii 11.25 Linting conanfile.py........................................... 161 12 Howtos 163 12.1 How to package header-only libraries.................................. 163 12.2 How to launch conan install from cmake................................ 165 12.3 How to create and reuse packages based on Visual Studio....................... 166 12.4 Creating and reusing packages based on Makefiles........................... 169 12.5 How to manage the GCC >= 5 ABI................................... 171 12.6 Using Visual Studio 2017 - CMake integration............................. 172 12.7 How to manage C++ standard...................................... 175 12.8 How to use docker to create and cross build C and C++ conan packages................ 176 12.9 How to reuse Python code in recipes................................... 179 12.10 How to create and share a custom generator with generator packages................. 182 12.11 How to manage shared libraries..................................... 185 12.12 How to reuse cmake install for package() method............................ 190 12.13 How to collaborate on other users’ packages.............................. 191 12.14 How to link with Apple Frameworks.................................. 192 12.15 How to package Apple Frameworks................................... 192 12.16 How to collect licenses of dependencies................................. 193 12.17 How to capture package version from SCM: git............................. 193 12.18 How to capture package version from text or build files......................... 194 12.19 How to use Conan as other language package manager......................... 194 12.20 How to manage SSL (TLS) certificates................................. 200 12.21 How to check the version of the Conan client inside a conanfile.................... 200 12.22 Use a generic CI with Conan and Artifactory.............................. 201 13 Reference 203 13.1 Commands................................................ 203 13.2 conanfile.txt............................................... 246 13.3 conanfile.py............................................... 248 13.4 Generators................................................ 274 13.5 Profiles.................................................. 291 13.6 Build helpers............................................... 295 13.7 Tools................................................... 311 13.8 Configuration files............................................ 331 13.9 Environment variables.......................................... 337 14 Videos and links 345 15 FAQ 347 15.1 Upgrading to conan 1.0......................................... 347 15.2 General.................................................. 349 15.3 Using conan............................................... 350 15.4 Troubleshooting............................................. 352 16 Changelog 355 16.1 1.6.1 (27-July-2018)........................................... 355 16.2 1.6.0 (19-July-2018)........................................... 355 16.3 1.5.2 (5-July-2018)............................................ 356 16.4 1.5.1 (29-June-2018)........................................... 356 16.5 1.5.0 (27-June-2018)........................................... 356 16.6 1.4.5 (22-June-2018)........................................... 357 16.7 1.4.4 (11-June-2018)........................................... 358 16.8 1.4.3 (6-June-2018)........................................... 358 16.9 1.4.2 (4-June-2018)........................................... 358 iii 16.10 1.4.1 (31-May-2018)........................................... 358 16.11 1.4.0 (30-May-2018)........................................... 358 16.12 1.3.3 (10-May-2018)........................................... 359 16.13 1.3.2 (7-May-2018)........................................... 359 16.14 1.3.1 (3-May-2018)........................................... 359 16.15 1.3.0 (30-April-2018).........................................