Submitted By:            Joe Locash <jlocash at gmail dot com>
Date:                    2025-10-25
Initial Package Version: 2.2.0
Upstream Status:         Applied
Origin:                  Upstream commit 3bcbae58
Description:             Fixes building libfm-qt against qt-6.10.

From 3bcbae5831f5ce3d2f06dc370f0c2ad0026ae82a Mon Sep 17 00:00:00 2001
From: Chiitoo <Chiitoo@users.noreply.github.com>
Date: Wed, 8 Oct 2025 19:47:01 +0300
Subject: [PATCH] cmake: fix build with Qt 6.10 (#1060)

The 'Qt6FooPrivate' targets have been split into separate CMake files
in Qt 6.9, and require a 'find_package(Qt6FooPrivate)' call starting
with Qt 6.10.

See also: https://bugreports.qt.io/browse/QTBUG-87776
---
 CMakeLists.txt     |  4 ++++
 src/CMakeLists.txt | 19 +++++++++++--------
 2 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8bf0e57b..40a19883 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -35,6 +35,10 @@ set(QT_MINIMUM_VERSION "6.6.0")
 find_package(Qt6Widgets "${QT_MINIMUM_VERSION}" REQUIRED)
 find_package(Qt6LinguistTools "${QT_MINIMUM_VERSION}" REQUIRED)
 
+if (Qt6Gui_VERSION VERSION_GREATER_EQUAL "6.10.0")
+    find_package(Qt6GuiPrivate REQUIRED)
+endif()
+
 find_package(lxqt2-build-tools "${LXQTBT_MINIMUM_VERSION}" REQUIRED)
 find_package(GLIB "${GLIB_MINIMUM_VERSION}" REQUIRED COMPONENTS gio gio-unix gobject gthread)
 find_package(MenuCache "${LIBMENUCACHE_MINIMUM_VERSION}" REQUIRED)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 377389a4..1be10c9d 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -132,14 +132,17 @@ install(EXPORT
 )
 
 target_link_libraries(${LIBFM_QT_LIBRARY_NAME}
-    Qt6::Widgets
-    ${GLIB_LIBRARIES}
-    ${GLIB_GIO_LIBRARIES}
-    ${GLIB_GOBJECT_LIBRARIES}
-    ${GLIB_GTHREAD_LIBRARIES}
-    ${MENUCACHE_LIBRARIES}
-    ${XCB_LIBRARIES}
-    ${EXIF_LIBRARIES}
+    PRIVATE
+        Qt6::GuiPrivate
+    PUBLIC
+        Qt6::Widgets
+        ${GLIB_LIBRARIES}
+        ${GLIB_GIO_LIBRARIES}
+        ${GLIB_GOBJECT_LIBRARIES}
+        ${GLIB_GTHREAD_LIBRARIES}
+        ${MENUCACHE_LIBRARIES}
+        ${XCB_LIBRARIES}
+        ${EXIF_LIBRARIES}
 )
 
 # set libtool soname
