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

Provide Qt5 <-> Q6 CMake compatible public API

    XMLWordPrintable

Details

    • User Story
    • Resolution: Done
    • P2: Important
    • None
    • None
    • Build System
    • 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

          For Gerrit Dashboard: QTBUG-80477
          # Subject Branch Project Status CR V

          Activity

            People

              alexandru.croitor Alexandru Croitor
              alexandru.croitor Alexandru Croitor
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: