qt_find_package marks package as not found but has found it?
-
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
isgrep -iInr *Wayland_LIBRARIES* ../
-
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:- when you request a package, CMake looks for a Find Module.
- once found, CMake executes the Find Module to locate the actual package.
- 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
tofalse
).It might help if you show the output that came after your snippet above.
Cheers.