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}")