summaryrefslogtreecommitdiffstats
path: root/source/kde/kde/patch/calligra/upstream_Small-CMake-modernization.patch
blob: c309a99d606eb95ba08fc341119eeb065a0a15dd (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
From 2ac46db52c6ad401f67ae5b5fcd859a5872f0311 Mon Sep 17 00:00:00 2001
From: Pierre Ducroquet <pinaraf@pinaraf.info>
Date: Sat, 1 May 2021 15:08:57 +0200
Subject: [PATCH] Small CMake modernization

Since we are now on CMake 3.2+, we can simplify policies.
And in order to simplify further, remove our use of
deprecated features in CMake.
---
 CMakeLists.txt                                | 21 +------------------
 cmake/modules/MacroCalligraAddBenchmark.cmake |  2 +-
 filters/words/msword-odf/wv2/CMakeLists.txt   |  7 +------
 .../wv2/src/generator/CMakeLists.txt          |  7 +------
 .../rtf/import/3rdparty/rtf-qt/CMakeLists.txt |  7 +------
 5 files changed, 5 insertions(+), 39 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index fe6502493ed..b237f68fcb6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,24 +4,9 @@ project(calligra)
 
 message(STATUS "Using CMake version: ${CMAKE_VERSION}")
 
-if (POLICY CMP0002)
-    cmake_policy(SET CMP0002 OLD)
-endif()
-if (POLICY CMP0017)
-    cmake_policy(SET CMP0017 NEW)
-endif ()
 if (POLICY CMP0022)
     cmake_policy(SET CMP0022 OLD)
 endif ()
-if (POLICY CMP0026)
-    cmake_policy(SET CMP0026 OLD)
-endif()
-if (POLICY CMP0046)
-    cmake_policy(SET CMP0046 OLD)
-endif ()
-if (POLICY CMP0059)
-    cmake_policy(SET CMP0059 OLD)
-endif()
 if (POLICY CMP0063)
     cmake_policy(SET CMP0063 NEW)
 endif()
@@ -105,11 +90,7 @@ endif()
 message(STATUS "Release build: ${RELEASE_BUILD}")
 
 # use CPP-11
-if (CMAKE_VERSION VERSION_LESS "3.1")
-    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
-else ()
-    set (CMAKE_CXX_STANDARD 11)
-endif ()
+set (CMAKE_CXX_STANDARD 11)
 
 ############
 #############
diff --git a/cmake/modules/MacroCalligraAddBenchmark.cmake b/cmake/modules/MacroCalligraAddBenchmark.cmake
index bfd1e1dc938..ad428a8459d 100644
--- a/cmake/modules/MacroCalligraAddBenchmark.cmake
+++ b/cmake/modules/MacroCalligraAddBenchmark.cmake
@@ -41,7 +41,7 @@ macro (CALLIGRA_ADD_BENCHMARK _test_NAME)
         endif()
     endforeach(_filename)
 
-    get_target_property( loc ${_test_NAME} LOCATION )
+    set(loc $<TARGET_FILE:${_test_NAME}>)
     if(WIN32)
       if(MSVC_IDE)
         string(REGEX REPLACE "\\$\\(.*\\)" "\${CTEST_CONFIGURATION_TYPE}" loc "${loc}")
diff --git a/filters/words/msword-odf/wv2/CMakeLists.txt b/filters/words/msword-odf/wv2/CMakeLists.txt
index 6f9cddfe018..421c20b60f1 100644
--- a/filters/words/msword-odf/wv2/CMakeLists.txt
+++ b/filters/words/msword-odf/wv2/CMakeLists.txt
@@ -1,12 +1,7 @@
-cmake_minimum_required(VERSION 2.8.0)
+cmake_minimum_required(VERSION 3.2)
 
 add_definitions(-DUNICODE -D_UNICODE)
 
-#cmake_policy CMP0017 was introduced in version 2.8.4
-if(${CMAKE_VERSION} VERSION_GREATER 2.8.3)
-    cmake_policy(SET CMP0017 NEW)
-endif()
-
 # wv2 versioning
 set( WV2_MAJOR_VERSION 0 )
 set( WV2_MINOR_VERSION 9 )
diff --git a/filters/words/msword-odf/wv2/src/generator/CMakeLists.txt b/filters/words/msword-odf/wv2/src/generator/CMakeLists.txt
index 7d5086a0ebd..10d1c022e9e 100644
--- a/filters/words/msword-odf/wv2/src/generator/CMakeLists.txt
+++ b/filters/words/msword-odf/wv2/src/generator/CMakeLists.txt
@@ -1,10 +1,5 @@
 # Generate parsers for some Word structures.
-cmake_minimum_required(VERSION 2.8.0)
-
-#cmake_policy CMP0017 was introduced in version 2.8.4
-if(${CMAKE_VERSION} VERSION_GREATER 2.8.3)
-    cmake_policy(SET CMP0017 NEW)
-endif()
+cmake_minimum_required(VERSION 3.2.0)
 
 set( scanner_word95
 	${CMAKE_CURRENT_BINARY_DIR}/word95_generated.h
diff --git a/filters/words/rtf/import/3rdparty/rtf-qt/CMakeLists.txt b/filters/words/rtf/import/3rdparty/rtf-qt/CMakeLists.txt
index 41e932d5869..cbd6ad9a83e 100644
--- a/filters/words/rtf/import/3rdparty/rtf-qt/CMakeLists.txt
+++ b/filters/words/rtf/import/3rdparty/rtf-qt/CMakeLists.txt
@@ -1,14 +1,9 @@
 project( RtfReader )
 
-cmake_minimum_required(VERSION 2.8.12)
+cmake_minimum_required(VERSION 3.2)
 
 include(GenerateExportHeader)
 
-#cmake_policy CMP0017 was introduced in version 2.8.4
-if(${CMAKE_VERSION} VERSION_GREATER 2.8.3)
-    cmake_policy(SET CMP0017 NEW)
-endif()
-
 find_package(Qt5 5.2.0 REQUIRED Gui)
 
 add_subdirectory( src )
-- 
2.35.1