From cd0e3235f6c0d29367d8c113db117296eb8bf281 Mon Sep 17 00:00:00 2001 From: Marcos Bento Date: Thu, 16 Jul 2026 17:29:55 +0100 Subject: [PATCH] Fix Qt5 dependency always declared in Debian package PackageDebian.cmake tested an undefined QT_VERSION variable, which always evaluated as less than 6.0.0, so the Debian package declared Qt5 dependencies even for Qt6 builds. Branch on Qt5_FOUND/Qt6_FOUND instead, and fail configure if neither is set while ENABLE_UI is on. --- cmake/PackageDebian.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/PackageDebian.cmake b/cmake/PackageDebian.cmake index a4b2bc0d3..1bf1cfa13 100644 --- a/cmake/PackageDebian.cmake +++ b/cmake/PackageDebian.cmake @@ -26,10 +26,12 @@ if(ENABLE_SSL) set(DEPENDS "${DEPENDS}, libssl-dev") endif() if(ENABLE_UI) - if(QT_VERSION VERSION_LESS "6.0.0") + if(Qt5_FOUND) set(DEPENDS "${DEPENDS}, libqt5widgets5, libqt5network5, libqt5gui5, libqt5core5a") - else() + elseif(Qt6_FOUND) set(DEPENDS "${DEPENDS}, libqt6widgets6, libqt6network6, libqt6gui6, libqt6core6") + else() + ecbuild_critical("ENABLE_UI is set but neither Qt5 nor Qt6 was found - cannot determine the Debian package's Qt dependencies") endif() endif() set(CPACK_DEBIAN_PACKAGE_DEPENDS "${DEPENDS}")