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

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 6.0
    • Build System: CMake

    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

              alexandru.croitor Alexandru Croitor
              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