]> git.lyx.org Git - lyx.git/commitdiff
Cmake build: Check for needed qt6 required packages before using QT6
authorKornel Benko <kornel@lyx.org>
Sat, 6 Apr 2024 08:34:00 +0000 (10:34 +0200)
committerKornel Benko <kornel@lyx.org>
Sat, 6 Apr 2024 08:34:00 +0000 (10:34 +0200)
compilation

CMakeLists.txt

index f473ee4bc563f0ee4e2d6460cfbd69b92a8bdcb8..4a843029f26e6eb75b46a242d2456ca906f43cab 100644 (file)
@@ -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}")