require at least Qt5 in CMake build scripts

This commit is contained in:
jkriege2 2024-01-15 13:37:34 +01:00
parent 498a552335
commit 14a614225d

View File

@ -5,6 +5,11 @@ set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
if(QT_VERSION_MAJOR LESS 5)
message(FATAL_ERROR "Minimum supported Qt version is 5, but you are trying to compile against Qt${QT_VERSION_MAJOR}")
endif()
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Widgets Svg Xml OpenGL REQUIRED)
if(${QT_VERSION_MAJOR} VERSION_GREATER_EQUAL "6")
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS OpenGLWidgets)