Add back mistakenly removed QT_MIN_VERSION in CMakeLists.txt

This commit is contained in:
Jonas Kvinge 2020-12-11 21:01:51 +01:00
parent 66c60ac5c7
commit 9149d1baa3
1 changed files with 5 additions and 4 deletions

View File

@ -166,6 +166,10 @@ endif()
set(QT_COMPONENTS Core Concurrent Widgets Network Sql)
unset(OPTIONAL_COMPONENTS)
if(QT_MAJOR_VERSION EQUAL 5)
set(QT_MIN_VERSION 5.8)
endif()
if(DBUS_FOUND)
list(APPEND QT_COMPONENTS DBus)
endif()
@ -176,10 +180,7 @@ if(WIN32)
list(APPEND OPTIONAL_COMPONENTS WinExtras)
endif()
find_package(Qt${QT_MAJOR_VERSION} REQUIRED COMPONENTS ${QT_COMPONENTS})
if(OPTIONAL_COMPONENTS)
find_package(Qt${QT_MAJOR_VERSION} OPTIONAL_COMPONENTS ${OPTIONAL_COMPONENTS})
endif(OPTIONAL_COMPONENTS)
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS ${QT_COMPONENTS} OPTIONAL_COMPONENTS ${OPTIONAL_COMPONENTS})
set(QtCore_LIBRARIES Qt${QT_MAJOR_VERSION}::Core)
set(QtConcurrent_LIBRARIES Qt${QT_MAJOR_VERSION}::Concurrent)