Cmake build: Check for needed qt6 required packages before using QT6

compilation
This commit is contained in:
Kornel Benko 2024-04-06 10:34:00 +02:00
parent 012c739668
commit 7c8f3a5d28

View File

@ -663,7 +663,16 @@ endif()
set(min_qt5_version "5.6") set(min_qt5_version "5.6")
if(LYX_USE_QT MATCHES "AUTO") if(LYX_USE_QT MATCHES "AUTO")
# try qt6 first # try qt6 first
find_package(Qt6Core CONFIG QUIET) foreach(_mod Core Gui Widgets Concurrent Svg)
find_package(Qt6${_mod} CONFIG QUIET)
if (NOT Qt6${_mod}_FOUND)
message(STATUS "Not found Qt6${_mod}, aborting use of QT6")
set(Qt6Core_FOUND OFF)
break()
else()
message(STATUS "Found Qt6${_mod}")
endif()
endforeach()
if (Qt6Core_FOUND) if (Qt6Core_FOUND)
set(LYX_USE_QT "QT6" CACHE STRING "Valid qt version" FORCE) set(LYX_USE_QT "QT6" CACHE STRING "Valid qt version" FORCE)
message(STATUS "Qt6Core_VERSION = ${Qt6Core_VERSION}") message(STATUS "Qt6Core_VERSION = ${Qt6Core_VERSION}")