From 56cc2cfa9ab1098e17d8e6f8684b2063b5bb8a82 Mon Sep 17 00:00:00 2001
From: Christophe Marin <christophe@krop.fr>
Date: Thu, 9 Oct 2025 23:09:27 +0200
Subject: [PATCH] Fix build with Qt 6.10

---
 .../Qt-Advanced-Docking-System/src/CMakeLists.txt         | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/scribus/third_party/Qt-Advanced-Docking-System/src/CMakeLists.txt b/scribus/third_party/Qt-Advanced-Docking-System/src/CMakeLists.txt
index d268f9a6f..8626d25c5 100644
--- a/scribus/third_party/Qt-Advanced-Docking-System/src/CMakeLists.txt
+++ b/scribus/third_party/Qt-Advanced-Docking-System/src/CMakeLists.txt
@@ -7,7 +7,11 @@ else()
   find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
 endif()
 find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Widgets REQUIRED)
+
 if (UNIX AND NOT APPLE)
+    if(DEFINED Qt6Gui_VERSION AND (Qt6Gui_VERSION VERSION_GREATER_EQUAL 6.10))
+        find_package(Qt6 COMPONENTS GuiPrivate REQUIRED)
+    endif()
     include_directories(${Qt${QT_VERSION_MAJOR}Gui_PRIVATE_INCLUDE_DIRS})
 endif()
 set(CMAKE_INCLUDE_CURRENT_DIR ON)
@@ -85,6 +89,10 @@ target_link_libraries(${library_name} PUBLIC Qt${QT_VERSION_MAJOR}::Core
                                                Qt${QT_VERSION_MAJOR}::Gui 
                                                Qt${QT_VERSION_MAJOR}::Widgets)
 if (UNIX AND NOT APPLE)
+  if(Qt6GuiPrivate_FOUND)
+      target_link_libraries(${library_name} PUBLIC Qt6::GuiPrivate)
+  endif()
+
   if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
       find_package(X11 REQUIRED)
       target_link_libraries(${library_name} PUBLIC X11::xcb)
-- 
2.51.0

