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

Packages installed with Conan can not be found via find_package(Qt6 COMPONENTS) method

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 6.0
    • Fix Version/s: None
    • Component/s: Build System: CMake
    • Labels:

      Description

      Our Qt6Config.cmake file limits on purpose the component search to the current Qt6/.. dir location using the NO_DEFAULT_PATH.

      This means that even if CMAKE_PREFIX_PATH is set to point to wherever Conan installed NetworkAuth, find_package(Qt6 COMPONENTS NetworkAuth) will report NetworkAuth is not found.

      A workaround is to call find_package(Qt6NetworkAuth) directly which would pick it up from CMAKE_PREFIX_PATH, bypassing the Qt6Config file.
      In such a case the dependencies need to be explicitly specified as well, which means that the working workaround code would be

       find_package(Qt6 COMPONENTS Network)
       find_package(Qt6NetworkAuth)
      

      Figure out why we limit the dir path and we if can disable it, or augment it with some additional variable where to look for packages.
      I suspect we limit it to, to ensure we don't pick up distro system CMake packages.

        Attachments

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              Assignee:
              alexandru.croitor Alexandru Croitor
              Reporter:
              alexandru.croitor Alexandru Croitor
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes