Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. qt_find_package marks package as not found but has found it?
Forum Updated to NodeBB v4.3 + New Features

qt_find_package marks package as not found but has found it?

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
2 Posts 2 Posters 227 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    qtSucks
    wrote on last edited by qtSucks
    #1

    Hi,
    hopefully someone can help me with this one.

    in a cmakelits.cmake there is

    set(wayland_libs
        Wayland::Client
        Wayland::Server
        Wayland::Cursor
        Wayland::Egl
    )
    
    foreach(lib IN LISTS wayland_libs)
        if(TARGET ${lib})
            qt_internal_disable_find_package_global_promotion(${lib})
        endif()
    endforeach()
    
    qt_find_package(Wayland 1.15 PROVIDED_TARGETS ${wayland_libs})
    

    when I run my configure command I append --debug-find to get debug info and send to a log file. In that log file I have.

    CMake Debug Log at qtbase/cmake/QtFindPackageHelpers.cmake:141 (find_package):
      find_package considered the following paths for FindWayland.cmake:
    
        /home/tommy/projects/rPi4_OS/crossCompile/qt6/qt5ReproQt6CodeAndBuild/qt5/qtwayland/../cmake/FindWayland.cmake
        /home/tommy/projects/rPi4_OS/crossCompile/qt6/qt5ReproQt6CodeAndBuild/qt5/qtwayland/cmake/FindWayland.cmake
        /home/tommy/projects/rPi4_OS/crossCompile/qt6/qt5ReproQt6CodeAndBuild/qt5/qtbase/cmake/FindWayland.cmake
        /home/tommy/projects/rPi4_OS/crossCompile/qt6/qt5ReproQt6CodeAndBuild/qtpi-build/qtbase/lib/cmake/Qt6BuildInternals/../Qt6/FindWayland.cmake
        /home/tommy/projects/rPi4_OS/crossCompile/qt6/qt5ReproQt6CodeAndBuild/qt5/qtbase/cmake/platforms/FindWayland.cmake
        /home/tommy/projects/rPi4_OS/crossCompile/qt6/qt5ReproQt6CodeAndBuild/qt5/cmake/FindWayland.cmake
        /home/tommy/projects/rPi4_OS/crossCompile/qt6/qt5ReproQt6CodeAndBuild/qt5/qtbase/cmake/FindWayland.cmake
        /usr/share/cmake-3.28/Modules/FindWayland.cmake
    
      The file was found at
    
        /home/tommy/projects/rPi4_OS/crossCompile/qt6/qt5ReproQt6CodeAndBuild/qt5/qtbase/cmake/3rdparty/extra-cmake-modules/find-modules/FindWayland.cmake
    
      The module is considered not found due to Wayland_FOUND being FALSE.
    Call Stack (most recent call first):
      qtwayland/src/CMakeLists.txt:23 (qt_find_package)
    

    So why does it say it has found the package, then state wayland_found is set to false?

    When I look at
    /home/tommy/projects/rPi4_OS/crossCompile/qt6/qt5ReproQt6CodeAndBuild/qt5/qtbase/cmake/3rdparty/extra-cmake-modules/find-modules/FindWayland.cmake

    it has

    find_package_handle_standard_args(Wayland
        FOUND_VAR
            Wayland_FOUND
        REQUIRED_VARS
            Wayland_LIBRARIES
        VERSION_VAR
            Wayland_VERSION
        HANDLE_COMPONENTS
    )
    

    but no where can I find what Wayland_LIBRARIES is

    grep -iInr *Wayland_LIBRARIES* ../

    1 Reply Last reply
    0
    • Paul ColbyP Offline
      Paul ColbyP Offline
      Paul Colby
      wrote on last edited by
      #2

      Hi @qtSucks,

      So why does it say it has found the package, then state wayland_found is set to false?

      It doesn't say it has found the package, it says it has found the Find Module. They way CMake find_package works is like so:

      1. when you request a package, CMake looks for a Find Module.
      2. once found, CMake executes the Find Module to locate the actual package.
      3. the Find Module sets variables (eg Wayland_FOUND) to indicate if Find Module found the package you're looking for (and where the libs are, etc).

      So here:

      find_package considered the following paths for FindWayland.cmake:
      ...
      The file was found at
      ...
      

      CMake is telling that the it found a Find Module at that location. CMake then should have evaluated the module, and that module reported that it can't find one or more of the libs you requested (ie set Wayland_FOUND to false).

      It might help if you show the output that came after your snippet above.

      Cheers.

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved