Details
-
User Story
-
Resolution: Done
-
P2: Important
-
None
-
None
-
None
Description
We discussed this a few times at workshops, and concluded that we need to provide public CMake API that would allow mixing Qt5 and Qt6 packages, or allow easy migration/switching between Qt5 and Qt6 packages.
This involves:
- Provide versionless target names (Qt5::Core, Qt6::Core vs just Qt::Core)
- Allow configuring whether the versionless targets should be created
- Allow choosing the default version that versionless targets point to (Qt5 or Qt6) from the application build system
- Provide versionless qt_ prefix functions and macros
- Allow choosing which versions' implementation the functions will use
- Provide versionless targets for tools
- (see at least tools created in qtbase/src/corelib/Qt5CoreConfigExtras.cmake.in and in qttools)
- Make enabled and disabled feature properties on targets to be compatible between Qt5 and Qt6 (same name)
- This involves adding the Qt6 style properties to Qt5
Some things that are not yet clear:
- Do we need versionless targets for plugins?
A good test case for this will be QtCreator, to be able to flip a switch to build it either against Qt5 or Qt6.
There already exists a patch to emulates some parts that we would need to implement hereĀ https://codereview.qt-project.org/c/qt-creator/qt-creator/+/274901/8/cmake/FindQt5.cmake#57
Attachments
Issue Links
- relates to
-
QTBUG-74137 Export versionless config files and targets that can be used by applications
- Closed
-
QTBUG-75984 Fix versionless target creation for tool packages
- Closed