From cd5fff614ad6934ba9d62acac076df6d0a468cc1 Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (o)" <j.wuttke@fz-juelich.de>
Date: Mon, 6 Jul 2020 16:39:18 +0200
Subject: [PATCH] CMake: Unify Qt configuration; require Qt 5.5.1

---
 GUI/ba3d/CMakeLists.txt                |  6 ------
 cmake/bornagain/modules/SearchQt.cmake | 13 +++----------
 2 files changed, 3 insertions(+), 16 deletions(-)

diff --git a/GUI/ba3d/CMakeLists.txt b/GUI/ba3d/CMakeLists.txt
index be45041d7ef..e7b3e778721 100644
--- a/GUI/ba3d/CMakeLists.txt
+++ b/GUI/ba3d/CMakeLists.txt
@@ -9,12 +9,6 @@ if(CMAKE_COMPILER_IS_GNUCXX)
     add_compile_options(-Wall -Wextra -Wpedantic)
 endif()
 
-find_package(Qt5 REQUIRED COMPONENTS Core Gui Widgets OpenGL)
-
-if(${Qt5Core_VERSION} VERSION_LESS "5.5.1")
-    message (FATAL_ERROR "Qt 5.5.1+ is required, have ${Qt5Core_VERSION_STRING}")
-endif()
-
 set(include_dirs ${CMAKE_CURRENT_SOURCE_DIR})
 include_directories(${include_dirs})
 
diff --git a/cmake/bornagain/modules/SearchQt.cmake b/cmake/bornagain/modules/SearchQt.cmake
index dd1920b3621..a44cda19554 100644
--- a/cmake/bornagain/modules/SearchQt.cmake
+++ b/cmake/bornagain/modules/SearchQt.cmake
@@ -9,16 +9,9 @@ find_package(Qt5Svg REQUIRED)
 
 message(STATUS "Found Qt5 version ${Qt5Widgets_VERSION}")
 
-if(${Qt5Widgets_VERSION_MINOR} LESS 4)
-    message(FATAL_ERROR "Qt5 version 5.4 required")
-endif()
-
-# checking 3D
-if(BORNAGAIN_OPENGL)
-    if(${Qt5Widgets_VERSION_MINOR} LESS 5)
-        message(WARNING "3D in BornAgain requires Qt=5.5.1+. Switching 3D support off: BORNAGAIN_OPENGL=OFF.")
-        set(BORNAGAIN_OPENGL OFF)
-    endif()
+if(${Qt5Core_VERSION} VERSION_LESS "5.5.1")
+    # required for OpenGL, hence for ba3d
+    message (FATAL_ERROR "Qt 5.5.1+ is required, have ${Qt5Core_VERSION_STRING}")
 endif()
 
 if(BORNAGAIN_OPENGL)
-- 
GitLab