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

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

      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.

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes