Conan Documentation Release 1.18.5
Total Page:16
File Type:pdf, Size:1020Kb
conan Documentation Release 1.18.5 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............................................9 2.5 Initial configuration...........................................9 2.6 Install from source............................................9 2.7 Update.................................................. 10 2.8 Python 2 Deprecation Notice....................................... 10 3 Getting Started 11 3.1 An MD5 Encrypter using the Poco Libraries.............................. 11 3.2 Installing Dependencies......................................... 14 3.3 Inspecting Dependencies......................................... 15 3.4 Searching Packages........................................... 18 3.5 Building with Other Configurations................................... 18 4 Using packages 21 4.1 Installing dependencies......................................... 21 4.2 Using profiles............................................... 26 4.3 Workflows................................................ 27 5 Creating Packages 31 5.1 Getting Started.............................................. 31 5.2 Recipe and Sources in a Different Repo................................. 36 5.3 Recipe and Sources in the Same Repo.................................. 37 5.4 Packaging Existing Binaries....................................... 40 5.5 Understanding Packaging........................................ 42 5.6 Defining Package ABI Compatibility.................................. 44 5.7 Inspecting Packages........................................... 52 5.8 Packaging Approaches.......................................... 53 5.9 Package Creator Tools.......................................... 58 6 Uploading Packages 59 i 6.1 Remotes................................................. 59 6.2 Uploading Packages to Remotes..................................... 60 6.3 Using Bintray............................................... 61 6.4 Artifactory Community Edition for C/C++............................... 63 6.5 Running conan_server.......................................... 64 7 Developing packages 71 7.1 Package development flow........................................ 71 7.2 Packages in editable mode........................................ 75 7.3 Workspaces................................................ 79 8 Package apps and devtools 85 8.1 Running and deploying packages.................................... 85 8.2 Creating conan packages to install dev tools............................... 88 8.3 Build requirements............................................ 91 9 Versioning 97 9.1 Introduction to versioning........................................ 97 9.2 Version ranges.............................................. 101 9.3 Package Revisions............................................ 102 9.4 Lockfiles................................................. 103 10 Mastering Conan 111 10.1 Use conanfile.py for consumers..................................... 111 10.2 Conditional settings, options and requirements............................. 113 10.3 Build policies............................................... 115 10.4 Environment variables.......................................... 115 10.5 Virtual Environments........................................... 117 10.6 Logging.................................................. 118 10.7 Sharing the settings and other configuration............................... 121 10.8 Conan local cache: concurrency, Continuous Integration, isolation................... 121 11 Systems and cross building 123 11.1 Cross-building.............................................. 123 11.2 Windows Subsystems.......................................... 131 12 Extending Conan 135 12.1 Customizing settings........................................... 135 12.2 Python requires: reusing code [EXPERIMENTAL]........................... 138 12.3 Hooks................................................... 142 13 Integrations 147 13.1 Build systems............................................... 147 13.2 IDEs................................................... 172 13.3 CI Platforms............................................... 187 13.4 Other Systems.............................................. 205 13.5 Version Control System......................................... 224 13.6 Custom integrations........................................... 225 13.7 Linting.................................................. 230 14 Howtos 231 14.1 How to package header-only libraries.................................. 231 14.2 How to launch conan install from cmake................................ 233 14.3 How to create and reuse packages based on Visual Studio....................... 234 14.4 Creating and reusing packages based on Makefiles........................... 237 ii 14.5 How to manage the GCC >= 5 ABI................................... 239 14.6 Using Visual Studio 2017 - CMake integration............................. 240 14.7 How to manage C++ standard [EXPERIMENTAL]........................... 243 14.8 How to use Docker to create and cross-build C and C++ Conan packages............... 244 14.9 How to reuse Python code in recipes................................... 247 14.10 How to create and share a custom generator with generator packages................. 250 14.11 How to manage shared libraries..................................... 253 14.12 How to reuse cmake install for package() method............................ 258 14.13 How to collaborate with other users’ packages............................. 259 14.14 How to link with Apple Frameworks.................................. 260 14.15 How to package Apple Frameworks................................... 260 14.16 How to collect licenses of dependencies................................. 261 14.17 How to extract licenses from headers.................................. 261 14.18 How to capture package version from SCM: git............................. 261 14.19 How to capture package version from SCM: svn............................ 262 14.20 How to capture package version from text or build files......................... 262 14.21 How to use Conan as other language package manager......................... 263 14.22 How to manage SSL (TLS) certificates................................. 268 14.23 How to check the version of the Conan client inside a conanfile.................... 269 14.24 Use a generic CI with Conan and Artifactory.............................. 270 14.25 Compiler sanitizers............................................ 271 15 Reference 275 15.1 Commands................................................ 275 15.2 conanfile.txt............................................... 332 15.3 conanfile.py............................................... 334 15.4 Generators................................................ 368 15.5 Profiles.................................................. 396 15.6 Build helpers............................................... 400 15.7 Tools................................................... 422 15.8 Configuration files............................................ 446 15.9 Environment variables.......................................... 458 15.10 Hooks [EXPERIMENTAL]....................................... 466 16 Videos and links 471 17 FAQ 473 17.1 Upgrading to Conan 1.0......................................... 473 17.2 General.................................................. 475 17.3 Using Conan............................................... 476 17.4 Troubleshooting............................................. 479 18 Changelog 483 18.1 1.18.5 (24-Sept-2019).......................................... 483 18.2 1.18.4 (12-Sept-2019).......................................... 483 18.3 1.18.3 (10-Sept-2019).......................................... 483 18.4 1.18.2 (30-Aug-2019).......................................... 483 18.5 1.18.1 (8-Aug-2019)........................................... 484 18.6 1.18.0 (30-Jul-2019)........................................... 484 18.7 1.17.2 (25-Jul-2019)........................................... 484 18.8 1.17.1 (22-Jul-2019)........................................... 484 18.9 1.17.0 (9-Jul-2019)............................................ 485 18.10 1.16.1 (14-Jun-2019)........................................... 486 18.11 1.16.0 (4-Jun-2019)........................................... 486 18.12 1.15.4................................................... 487 iii 18.13 1.15.3................................................... 487 18.14 1.15.2 (31-May-2019).......................................... 487 18.15 1.15.1 (16-May-2019).......................................... 487 18.16 1.15.0 (6-May-2019)........................................... 488 18.17 1.14.5 (30-Apr-2019)........................................... 489 18.18 1.14.4 (25-Apr-2019)........................................... 489 18.19 1.14.3 (11-Apr-2019)........................................... 489 18.20 1.14.2 (11-Apr-2019)..........................................