From 383f326136635063c80a31772675371fc58861da Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 28 Jul 2021 07:44:56 -0700 Subject: [PATCH] build-system: fail with Qt6 I thought that explicitly requesting Qt5 should be enough, but we have a report from a user who tried to build against Qt6 and cmake happily let them proceed. So let's fail this explicitly. Signed-off-by: Dirk Hohndel --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5850462f7..bac09ae8d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -299,6 +299,13 @@ elseif (SUBSURFACE_TARGET_EXECUTABLE MATCHES "DownloaderExecutable") find_package(Qt5 5.11 REQUIRED COMPONENTS ${QT_FIND_COMPONENTS}) set(MAKE_TESTS OFF) endif() +# we don't support Qt6 +# the comparison with an invalid version of 5.15 ensures that this will keep working even if +# there are newer Qt 5.15 versions over time (which is unfortunately doubtful) +if (Qt5Core_VERSION VERSION_GREATER 5.15.15) + message(FATAL_ERROR "Subsurface cannot be built against Qt 6 or later") +endif() + foreach(_QT_COMPONENT ${QT_FIND_COMPONENTS}) list(APPEND QT_LIBRARIES Qt5::${_QT_COMPONENT}) endforeach()