summaryrefslogtreecommitdiff
path: root/user/spectacle/kconfig.patch
diff options
context:
space:
mode:
Diffstat (limited to 'user/spectacle/kconfig.patch')
-rw-r--r--user/spectacle/kconfig.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/user/spectacle/kconfig.patch b/user/spectacle/kconfig.patch
new file mode 100644
index 000000000..2d1860f2e
--- /dev/null
+++ b/user/spectacle/kconfig.patch
@@ -0,0 +1,40 @@
+From cab0844fef8bc6e7491978307245aadf65d64409 Mon Sep 17 00:00:00 2001
+From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
+Date: Thu, 15 Aug 2019 09:05:28 -0500
+Subject: [PATCH] Define QT_NO_FOREACH only if KConfig > 5.56.0
+
+Spectacle cannot be compiled with KConfig <= 5.56.0 otherwise, because
+KConfig uses Q_FOREACH in its public headers.
+
+Tested on: KConfig 5.54.0 / Qt 5.9.7
+---
+ CMakeLists.txt | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 78eae41..79eb869 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -40,7 +40,7 @@ include(FeatureSummary)
+ include(ECMQtDeclareLoggingCategory)
+ include(ECMAddTests)
+
+-add_definitions(-DQT_NO_URL_CAST_FROM_STRING -DQT_NO_CAST_FROM_ASCII -DQT_NO_FOREACH)
++add_definitions(-DQT_NO_URL_CAST_FROM_STRING -DQT_NO_CAST_FROM_ASCII)
+
+ find_package(
+ Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED
+@@ -67,6 +67,10 @@ find_package(
+ XmlGui
+ )
+
++if(${KF5Config_VERSION} STRGREATER "5.56.0")
++ add_definitions(-DQT_NO_FOREACH)
++endif()
++
+ # optional components
+
+ find_package(KF5Kipi)
+--
+2.22.0
+