Usage of KF5/KF6 in targets and CMake config files outside of Frameworks
Friedrich W. H. Kossebau
kossebau at kde.org
Fri Mar 10 18:27:02 GMT 2023
Am Freitag, 10. März 2023, 05:24:40 CET schrieb Kevin Kofler:
> Heiko Becker wrote:
> > while looking at a MR for libkcddb (part of Gear) I wondered if the
> > transition from Qt5/KF5 to Qt6/KF6 could be used to get rid of the KF5/6
> > prefix in target names and CMake config files for libraries that aren't
> > acutally part of Frameworks.
>
> Huh? This kind of transition is exactly where the prefix is most valuable,
> because it ensures that you get a compatible version of the library, i.e.,
> that you do not accidentally get, e.g., a version of KF5Cddb when you are
> looking for KF6Cddb.
That logic though applied consequently, we should have named all libraries
Qt5Foo and now Qt6Foo, so one really can be sure that the libs are compatible
with the respective Qt version. But we did not do that for a reason.
Because the prefix most importantly hints to a product group. And that one
comes with certain properties, e.g. versioning or maintainers.
--- 8< ---
find_package(KF5 REQUIRED COMPONENTS
I18n
Cddb
AkonadiContact
KMahjongglib
)
--- 8< ---
works (and I have seen variants of that in real life), but it is just wrong,
even more when using version numbers.
A number in a library name usually is used to denote the major version of the
library itself. In case of libraries extending/using the Qt toolkit, like our
KDE products, many products share the API cycle of Qt, and thus also see to
align the version numbers, at least the major one.
But that is just by chance. A number of libraries for reasons have shorter API
cycles. So cannot keep their major version number in sync with the supported
Qt version. So the library number as clue for the used Qt version is not
possible, instead other means might be needed. Especially in case the same
library version can be built with multiple major Qt versions and co-installed.
In that case postfixes with "qtX" usually have been used (not sure I fancy
that postfix, just describing a fact).
So, "KFx" as generic prefix to express the aspect "library from KDE using Qt
x" will not work across the board sadly. Rather risks people to have wrong
expectations about full versions and other product properties for a given
library.
Instead "KFx" should stay a product identifier for KF modules, and any
accidental misuses healed when possible. Other product libraries names would
still try to match the Qt version of course where feasible, but by other
patterns.
Cheers
Friedrich
More information about the kde-core-devel
mailing list