Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-74769

Qt6: Evaluate conan.io package manager from developer perspective (Vitaly)

    XMLWordPrintable

Details

    • Task
    • Resolution: Done
    • P2: Important
    • None
    • None
    • Packaging & Installer
    • 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: 

      1. Python3 
      2. Pip 
      3. 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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              vitaly.fanaskov Vitaly Fanaskov
              olhirvon Olli Hirvonen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes