Details
-
Task
-
Resolution: Done
-
P2: Important
-
None
-
None
-
None
Description
Summary:
Brief: https://github.com/conan-io/conan
Docs: https://docs.conan.io/en/latest
Package center: https://bintray.com/conan/conan-center
You need to install:
- Python3
- Pip
- Conan as a package
You need to add repositories, for example:
conan remote add conan-bintray https://api.bintray.com/conan/bincrafters/public-conan
You can search libraries or inspect dependencies, but for searching you have to specify a repository, for example:
conan search libcurl --remote=conan-bintray
You need to create conanfile.txt with dependencies description and run “conan install”.
CMakeLists.txt example:
cmake_minimum_required(VERSION 3.0) project(CurlTst) include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup() add_executable(curl_tst main.c) target_link_libraries(curl_tst ${CONAN_LIBS})
Everything will be automatically located, linked, and set.
Pros:
- Relatively easy to install
- Mac/Windows/Linux
- It is possible to use pre-built artifacts as well as build dependencies
- Handles transitive dependencies during installation
- You need to create a separate file with dependencies description (modern and explicit approach)
- Handles transitive dependencies on CMake level
- CMake file itself is the way smaller
- You don’t need to specify any of dependencies in the CMake file at all
- Version is in the package name which makes things easier
- The latest qt is already available, but you need to build it from source. This also means that there are already ready-to-use configuration we can look into
- It is easy to build something missing: just add “--build smth” flag to “conan install” command
- Package creating is relatively easy process: tools are almost perfect, and you can write any custom logic on Python
- The documentation is solid and comprehensive
- Big community
Cons:
- Python is required
- You still need to call two phases manually: conan install (to generate all extra files, and download dependencies if they are not already downloaded), and then CMake
- Conan creates some extra files in the build directory
- Python knowledge are required for developing packages
Attachments
Issue Links
- is required for
-
QTBUG-74405 Qt6: Research on package managers
- Closed