Qt6 ports of applications

Marius Kittler mkittler at suse.de
Thu Mar 18 08:11:35 GMT 2021


> Qt's solution for this is to introduce versionless CMake targets, e.g.
> instead of Qt5::Core or Qt6::Core you write Qt::Core. That's only
> available from Qt 5.15 though, that's why Frameworks does not make use
> of that yet (since it supports 5.14 too).

I know and since it is only available in Qt 5.15 I've just added

```
set(QT_PACKAGE_PREFIX "Qt5" CACHE STRING "specifies the prefix for Qt 
packages")
set(KF_PACKAGE_PREFIX "KF5" CACHE STRING "specifies the prefix for KDE 
Frameworks packages")
```

in my projects and use that all over the place. Not fancy but it does its job 
and the user can also easily select the version to build against (and 
hopefully doesn't select an unsupported one).

For my own libraries and applications I simply allow setting a configuration 
name via a similar cache variable at the time it is built and consumed. Also 
not very fancy because it is yet another cache variable one has to use all 
over the place but it is still quite useful as it generally allows the 
installation and use of two differently configured versions of a library/
application.

I'd also like to note that the versioning of my own libraries/applications is 
independent of the versioning of its dependencies, including Qt. This seems 
more natural to me compared to KDE's approach. And yes, it means the same 
version the library can be configured differently resulting in differently 
named binaries with different ABIs. However, it looks like other projects like 
poppler did it similarly.

By the way, the "Required By" column of Arch Linux's qt6-base package shows a 
few more applications which have already been ported to Qt 6. The list is 
(slowly) growing: https://archlinux.org/packages/extra/x86_64/qt6-base





More information about the kde-community mailing list