Qt 6 Additional Libraries via Package Manager

With Qt 6 we want to provide more flexibility via leveraging a package manager in addition to Qt Online Installer. The new package manager functionality, based on conan.io (https://conan.io), allows providing more packages to the users without increasing the complexity of the baseline Qt. In addition to the packages provided by Qt, the package manager can be used for getting content from other sources. 

Initially, we have three Additional Libraries provided via the package manager: Qt Network Authorization, Qt Image Formats, and Qt 3D. More Additional Libraries will be available in forthcoming Qt 6 releases. We are currently leveraging the existing Qt delivery system as the backend for the Additional Libraries available via the package manager. 

How the packages are managed? 

The required tools, Conan, CMake, and Ninja, can be easily installed using the Qt Online installer 4.0, which is going to be released soon. The Conan build recipes for Additional Libraries require CMake and Ninja to build the module. The project linking to the module can be qmake-based as well. 

Once installed, the selected Additional Libraries can be built once by using Conan per selected target configuration. After the build, the binary package is available in user’s local Conan cache, and can be linked to any other project. 

How to get and build the packages? 

An example build call looks like this: 

$conan.exe install qtnetworkauth/6.0.0@qt/beta --build=missing 
--profile=<QtSdk>/Tools/Conan/profiles/qt-6.0.0-msvc2019_64 -s
build_type=Release -g cmake_paths -g=cmake -g deploy 

 

Now, let's look what that contains:

  • qtnetworkauth/6.0.0@qt/beta 
    • This is the Conan reference for the package
    • You can search available packages in your Conan cache by:  $conan.exe search 
  • --profile 
    • This file is installed by the Qt installer. Each Qt 6 Essential package installed by the Qt Installer installs also a matching profile file. This tells Conan the target build configuration. 
    • The user needs to select a suitable profile, that is the target build configuration. 
  • -g 
    • If your consuming project is a CMake project then use the CMake generators 
    • If your consuming project is a qmake project then you can pass: -g qmake 
    • The “deploy” generator deploys the built Additional Library from the Conan cache to your working environment. This is useful if you want to bundle your application files together. 

For detailed steps see the instructions. 

Currently, Qt Online Installer exports the Additional Library packages (sources and build recipes) into the Conan cache. There is no Conan remote that hosts the Additional Library Conan packages. 

Next steps 

Like Qt 6.0, the current work is still in beta phase and all feedback is welcome. Note that currently the Conan profile files and build recipies for Android and iOS targets are being worked on. Also, the build recipes of the Additional Libraries are not part of the repositories yet.  Once the build recipes are mature the plan is to move those into module repositories. 

If you want to have a look already now, how the conanfile.py recipes look like, those can be found in the Qt installation, under each module in “AdditionalLibraries/Qt/”. 

 

Blog Topics:

Comments