[gui] Add KGuiAddons as an optional dependency
authorKevin Ottens <ervin@kde.org>
Wed, 6 Mar 2024 17:17:55 +0000 (18:17 +0100)
committerKevin Ottens <ervin@kde.org>
Thu, 7 Mar 2024 07:18:52 +0000 (08:18 +0100)
This will be needed to replace QClipboard in some places.

Signed-off-by: Kevin Ottens <ervin@kde.org>
src/gui/CMakeLists.txt

index 097e4df7909e0404e31c1f677ffc64113d2449c5..a921ea1a6ea844f6d4917923e9377c70464f219e 100644 (file)
@@ -1,6 +1,7 @@
 project(gui)
 find_package(Qt5 REQUIRED COMPONENTS Widgets Svg Qml Quick QuickControls2 QuickWidgets Xml Network)
 find_package(KF5Archive REQUIRED)
+find_package(KF5GuiAddons)
 
 if(QUICK_COMPILER)
         find_package(Qt5QuickCompiler)
@@ -563,6 +564,14 @@ target_link_libraries(nextcloudCore
   KF5::Archive
   )
 
+if(KF5GuiAddons_FOUND)
+  target_link_libraries(nextcloudCore
+    PUBLIC
+    KF5::GuiAddons
+  )
+  add_definitions(-DHAVE_KGUIADDONS)
+endif()
+
 add_subdirectory(socketapi)
 
 # skip unity inclusion for files which cause problems with a CMake unity build