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

Problematic calling of qt_find_package(Qt6) in qt_internal_project_setup

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.8.0 Beta1
    • Build System: CMake
    • None
    • b37c0d7c6 (dev)

    Description

      Once https://codereview.qt-project.org/c/qt/qtbase/+/535840 landed, we started calling qt_find_package(Qt6 PROVIDED_TARGETS PlatformCommonInternal ...)
      in qt_internal_project_setup for every repo configuration.

      This was done to avoid some issues with Threads::Threads And Platform not being global when building the Quick3D OpenXR 3rd party:

      https://codereview.qt-project.org/c/qt/qtquick3d/+/535738/1/src/xr/quick3dxr/CMakeLists.txt#57

      The fix that fixed the issue uses qt_find_package to recursively promote the Platform targets to global

      The problem is that qt_find_package is really only meant to be called for 3rd party libraries, not Qt itself, otherwise some code paths might consider the Platform targets and the Qt6 package as a 3rd party dependency. This is also troublesome for the upcoming SBOM file creation which needs to accurately track what are the 3rd party dependencies.

      We should check if we can avoid the usage of qt_find_package for the original issue and replace it with custom global promotion code, or perhaps use some flag to differentiate the Qt6 package specifically.

      Attachments

        Issue Links

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

          Activity

            People

              qtbuildsystem Qt Build System Team
              alexandru.croitor Alexandru Croitor
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes