blob: 2d1860f2e87c9820a5c2823e0c70ae49a33fdf19 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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
|