From 7c8f3a5d28bf7d9e745e5c1d8e36f4e40778bfa9 Mon Sep 17 00:00:00 2001 From: Kornel Benko Date: Sat, 6 Apr 2024 10:34:00 +0200 Subject: [PATCH] Cmake build: Check for needed qt6 required packages before using QT6 compilation --- CMakeLists.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f473ee4bc5..4a843029f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -663,7 +663,16 @@ endif() set(min_qt5_version "5.6") if(LYX_USE_QT MATCHES "AUTO") # 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) set(LYX_USE_QT "QT6" CACHE STRING "Valid qt version" FORCE) message(STATUS "Qt6Core_VERSION = ${Qt6Core_VERSION}")