summaryrefslogtreecommitdiff
blob: 0a7c7ca698460e792136d1bb66113d5a77c8819a (plain)
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
From dae9ddcd45a95fd3b1ec3d42510556a671b08f15 Mon Sep 17 00:00:00 2001
From: Andreas Sturmlechner <asturm@gentoo.org>
Date: Tue, 31 Mar 2020 19:56:48 +0200
Subject: [PATCH 1/2] Revert "Revert "Use e-c-m's findopenexr.cmake module""

This reverts commit d978a33acebb724b862c38895788fc459111c364.

Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
---
 CMakeLists.txt                  |  2 +-
 cmake/modules/FindOpenEXR.cmake | 98 ---------------------------------
 2 files changed, 1 insertion(+), 99 deletions(-)
 delete mode 100644 cmake/modules/FindOpenEXR.cmake

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a7d9adaa3f..7a4211da13 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -251,7 +251,7 @@ endif(MINGW)
 ########################
 
 find_package(ECM 5.22 REQUIRED NOMODULE)
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${ECM_FIND_MODULE_DIR})
 include(ECMOptionalAddSubdirectory)
 include(ECMAddAppIcon)
 include(ECMSetupVersion)
diff --git a/cmake/modules/FindOpenEXR.cmake b/cmake/modules/FindOpenEXR.cmake
deleted file mode 100644
index bb75a03bf0..0000000000
--- a/cmake/modules/FindOpenEXR.cmake
+++ /dev/null
@@ -1,98 +0,0 @@
-#
-# Copyright 2016 Pixar
-#
-# Licensed under the Apache License, Version 2.0 (the "Apache License")
-# with the following modification; you may not use this file except in
-# compliance with the Apache License and the following modification to it:
-# Section 6. Trademarks. is deleted and replaced with:
-#
-# 6. Trademarks. This License does not grant permission to use the trade
-#    names, trademarks, service marks, or product names of the Licensor
-#    and its affiliates, except as required to comply with Section 4(c) of
-#    the License and to reproduce the content of the NOTICE file.
-#
-# You may obtain a copy of the Apache License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the Apache License with the above modification is
-# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the Apache License for the specific
-# language governing permissions and limitations under the Apache License.
-#
-
-find_path(OPENEXR_INCLUDE_DIR
-    OpenEXR/half.h
-HINTS
-    "${OPENEXR_LOCATION}"
-    "$ENV{OPENEXR_LOCATION}"
-PATH_SUFFIXES
-    include/
-DOC
-    "OpenEXR headers path"
-)
-
-if(OPENEXR_INCLUDE_DIR)
-  set(openexr_config_file "${OPENEXR_INCLUDE_DIR}/OpenEXR/OpenEXRConfig.h")
-  if(EXISTS ${openexr_config_file})
-      file(STRINGS
-           ${openexr_config_file}
-           TMP
-           REGEX "#define OPENEXR_VERSION_STRING.*$")
-      string(REGEX MATCHALL "[0-9.]+" OPENEXR_VERSION ${TMP})
-
-      file(STRINGS
-           ${openexr_config_file}
-           TMP
-           REGEX "#define OPENEXR_VERSION_MAJOR.*$")
-      string(REGEX MATCHALL "[0-9]" OPENEXR_MAJOR_VERSION ${TMP})
-
-      file(STRINGS
-           ${openexr_config_file}
-           TMP
-           REGEX "#define OPENEXR_VERSION_MINOR.*$")
-      string(REGEX MATCHALL "[0-9]" OPENEXR_MINOR_VERSION ${TMP})
-  endif()
-endif()
-
-foreach(OPENEXR_LIB
-    Half
-    Iex
-    Imath
-    IlmImf
-    IlmThread
-    )
-
-    # OpenEXR libraries may be suffixed with the version number, so we search
-    # using both versioned and unversioned names.
-    find_library(OPENEXR_${OPENEXR_LIB}_LIBRARY
-        NAMES
-            ${OPENEXR_LIB}-${OPENEXR_MAJOR_VERSION}_${OPENEXR_MINOR_VERSION}
-            ${OPENEXR_LIB}
-        HINTS
-            "${OPENEXR_LOCATION}"
-            "$ENV{OPENEXR_LOCATION}"
-        PATH_SUFFIXES
-            lib/
-        DOC
-            "OPENEXR's ${OPENEXR_LIB} library path"
-    )
-
-    if(OPENEXR_${OPENEXR_LIB}_LIBRARY)
-        list(APPEND OPENEXR_LIBRARIES ${OPENEXR_${OPENEXR_LIB}_LIBRARY})
-    endif()
-endforeach(OPENEXR_LIB)
-
-# So #include <half.h> works
-list(APPEND OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR})
-list(APPEND OPENEXR_INCLUDE_DIRS ${OPENEXR_INCLUDE_DIR}/OpenEXR)
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(OpenEXR
-    REQUIRED_VARS
-        OPENEXR_INCLUDE_DIRS
-        OPENEXR_LIBRARIES
-    VERSION_VAR
-        OPENEXR_VERSION
-)
-- 
2.26.0


From b6e1c9c015989c47688c3cc3efa85e51eb02696f Mon Sep 17 00:00:00 2001
From: Andreas Sturmlechner <asturm@gentoo.org>
Date: Thu, 2 Apr 2020 14:49:10 +0200
Subject: [PATCH 2/2] For ECM FindOpenEXR.cmake, in CMakeLists.txt, do
 s/OPENEXR/OpenEXR/

---
 CMakeLists.txt                                       |  8 ++++----
 libs/image/CMakeLists.txt                            |  4 ++--
 libs/pigment/CMakeLists.txt                          |  6 +++---
 libs/ui/CMakeLists.txt                               |  2 +-
 plugins/color/colorspaceextensions/CMakeLists.txt    |  2 +-
 plugins/color/lcms2engine/CMakeLists.txt             | 10 +++++-----
 plugins/color/lcms2engine/tests/CMakeLists.txt       |  4 ++--
 plugins/dockers/specificcolorselector/CMakeLists.txt |  2 +-
 plugins/impex/CMakeLists.txt                         |  2 +-
 plugins/impex/exr/CMakeLists.txt                     |  6 +++---
 plugins/impex/raw/CMakeLists.txt                     |  4 ++--
 11 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7a4211da13..5ff18bbb17 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -571,11 +571,11 @@ set_package_properties(OpenEXR PROPERTIES
     URL "http://www.openexr.com"
     TYPE OPTIONAL
     PURPOSE "Required by the Krita OpenEXR filter")
-macro_bool_to_01(OPENEXR_FOUND HAVE_OPENEXR)
+macro_bool_to_01(OpenEXR_FOUND HAVE_OPENEXR)
 set(LINK_OPENEXR_LIB)
-if(OPENEXR_FOUND)
-    include_directories(SYSTEM ${OPENEXR_INCLUDE_DIRS})
-    set(LINK_OPENEXR_LIB ${OPENEXR_LIBRARIES})
+if(OpenEXR_FOUND)
+    include_directories(SYSTEM ${OpenEXR_INCLUDE_DIRS})
+    set(LINK_OPENEXR_LIB ${OpenEXR_LIBRARIES})
     add_definitions(${OPENEXR_DEFINITIONS})
 endif()
 
diff --git a/libs/image/CMakeLists.txt b/libs/image/CMakeLists.txt
index 6d7c6a4daa..74d78103ab 100644
--- a/libs/image/CMakeLists.txt
+++ b/libs/image/CMakeLists.txt
@@ -349,8 +349,8 @@ if(NOT HAVE_CXX_ATOMICS_WITHOUT_LIB)
     endif()
 endif()
 
-if(OPENEXR_FOUND)
-  target_link_libraries(kritaimage PUBLIC ${OPENEXR_LIBRARIES})
+if(OpenEXR_FOUND)
+  target_link_libraries(kritaimage PUBLIC ${OpenEXR_LIBRARIES})
 endif()
 
 if(FFTW3_FOUND)
diff --git a/libs/pigment/CMakeLists.txt b/libs/pigment/CMakeLists.txt
index 2a574a6c77..53e34cc029 100644
--- a/libs/pigment/CMakeLists.txt
+++ b/libs/pigment/CMakeLists.txt
@@ -14,9 +14,9 @@ include_directories(
 
 set(FILE_OPENEXR_SOURCES)
 set(LINK_OPENEXR_LIB)
-if(OPENEXR_FOUND)
-    include_directories(SYSTEM ${OPENEXR_INCLUDE_DIRS})
-    set(LINK_OPENEXR_LIB ${OPENEXR_LIBRARIES})
+if(OpenEXR_FOUND)
+    include_directories(SYSTEM ${OpenEXR_INCLUDE_DIRS})
+    set(LINK_OPENEXR_LIB ${OpenEXR_LIBRARIES})
     add_definitions(${OPENEXR_DEFINITIONS})
 endif()
 
diff --git a/libs/ui/CMakeLists.txt b/libs/ui/CMakeLists.txt
index 73f36e4e68..151c46f711 100644
--- a/libs/ui/CMakeLists.txt
+++ b/libs/ui/CMakeLists.txt
@@ -576,7 +576,7 @@ if(APPLE)
 endif ()
 
 
-target_link_libraries(kritaui ${OPENEXR_LIBRARIES})
+target_link_libraries(kritaui ${OpenEXR_LIBRARIES})
 
 # Add VSync disable workaround
 if(NOT WIN32 AND NOT APPLE)
diff --git a/plugins/color/colorspaceextensions/CMakeLists.txt b/plugins/color/colorspaceextensions/CMakeLists.txt
index ee8033afed..523e11cfb9 100644
--- a/plugins/color/colorspaceextensions/CMakeLists.txt
+++ b/plugins/color/colorspaceextensions/CMakeLists.txt
@@ -12,5 +12,5 @@ set( extensions_plugin_SOURCES
 )
 
 add_library(krita_colorspaces_extensions MODULE ${extensions_plugin_SOURCES} )
-target_link_libraries(krita_colorspaces_extensions kritapigment kritaglobal ${OPENEXR_LIBRARIES} KF5::I18n KF5::CoreAddons)
+target_link_libraries(krita_colorspaces_extensions kritapigment kritaglobal ${OpenEXR_LIBRARIES} KF5::I18n KF5::CoreAddons)
 install( TARGETS krita_colorspaces_extensions DESTINATION ${KRITA_PLUGIN_INSTALL_DIR} )
diff --git a/plugins/color/lcms2engine/CMakeLists.txt b/plugins/color/lcms2engine/CMakeLists.txt
index e14de2ba7c..109a708b2d 100644
--- a/plugins/color/lcms2engine/CMakeLists.txt
+++ b/plugins/color/lcms2engine/CMakeLists.txt
@@ -28,7 +28,7 @@ include_directories(
     ${CMAKE_CURRENT_SOURCE_DIR}/colorprofiles
 )
 
-if (HAVE_LCMS24 AND OPENEXR_FOUND)
+if (HAVE_LCMS24 AND OpenEXR_FOUND)
 include_directories( 
     ${CMAKE_CURRENT_SOURCE_DIR}/colorspaces/gray_f16
     ${CMAKE_CURRENT_SOURCE_DIR}/colorspaces/rgb_f16
@@ -38,9 +38,9 @@ endif ()
 
 set(FILE_OPENEXR_SOURCES)
 set(LINK_OPENEXR_LIB)
-if(OPENEXR_FOUND)
-    include_directories(SYSTEM ${OPENEXR_INCLUDE_DIRS})
-    set(LINK_OPENEXR_LIB ${OPENEXR_LIBRARIES})
+if(OpenEXR_FOUND)
+    include_directories(SYSTEM ${OpenEXR_INCLUDE_DIRS})
+    set(LINK_OPENEXR_LIB ${OpenEXR_LIBRARIES})
     add_definitions(${OPENEXR_DEFINITIONS})
 endif()
 
@@ -77,7 +77,7 @@ set ( lcmsengine_SRCS
     LcmsEnginePlugin.cpp
 )
 
-if (HAVE_LCMS24 AND OPENEXR_FOUND)
+if (HAVE_LCMS24 AND OpenEXR_FOUND)
     set ( lcmsengine_SRCS
         ${lcmsengine_SRCS}
         colorspaces/gray_f16/GrayF16ColorSpace.cpp
diff --git a/plugins/color/lcms2engine/tests/CMakeLists.txt b/plugins/color/lcms2engine/tests/CMakeLists.txt
index eea9e9e846..87ca907148 100644
--- a/plugins/color/lcms2engine/tests/CMakeLists.txt
+++ b/plugins/color/lcms2engine/tests/CMakeLists.txt
@@ -12,8 +12,8 @@ include_directories( ../colorspaces/cmyk_u16
     ../colorprofiles
     ..
 )
-if(OPENEXR_FOUND)
-    include_directories(SYSTEM ${OPENEXR_INCLUDE_DIRS})
+if(OpenEXR_FOUND)
+    include_directories(SYSTEM ${OpenEXR_INCLUDE_DIRS})
 endif()
 include_directories( ${LCMS2_INCLUDE_DIR} )
 
diff --git a/plugins/dockers/specificcolorselector/CMakeLists.txt b/plugins/dockers/specificcolorselector/CMakeLists.txt
index 97f7ab2cdd..214a46eaa9 100644
--- a/plugins/dockers/specificcolorselector/CMakeLists.txt
+++ b/plugins/dockers/specificcolorselector/CMakeLists.txt
@@ -10,5 +10,5 @@ ki18n_wrap_ui(KRITA_SPECIFICCOLORSELECTOR_SOURCES
 
 
 add_library(kritaspecificcolorselector MODULE ${KRITA_SPECIFICCOLORSELECTOR_SOURCES})
-target_link_libraries(kritaspecificcolorselector kritaui ${OPENEXR_LIBRARIES})
+target_link_libraries(kritaspecificcolorselector kritaui ${OpenEXR_LIBRARIES})
 install(TARGETS kritaspecificcolorselector  DESTINATION ${KRITA_PLUGIN_INSTALL_DIR})
diff --git a/plugins/impex/CMakeLists.txt b/plugins/impex/CMakeLists.txt
index 51056ecf47..838f34b6eb 100644
--- a/plugins/impex/CMakeLists.txt
+++ b/plugins/impex/CMakeLists.txt
@@ -19,7 +19,7 @@ if(PNG_FOUND)
     add_subdirectory(csv)
 endif()
 
-if(OPENEXR_FOUND)
+if(OpenEXR_FOUND)
     add_subdirectory(exr)
 endif()
 
diff --git a/plugins/impex/exr/CMakeLists.txt b/plugins/impex/exr/CMakeLists.txt
index aa39a91879..cb07f6b01a 100644
--- a/plugins/impex/exr/CMakeLists.txt
+++ b/plugins/impex/exr/CMakeLists.txt
@@ -1,6 +1,6 @@
 add_subdirectory(tests)
 
-include_directories(SYSTEM ${OPENEXR_INCLUDE_DIRS} )
+include_directories(SYSTEM ${OpenEXR_INCLUDE_DIRS} )
 
 add_definitions(${OPENEXR_DEFINITIONS})
 
@@ -17,7 +17,7 @@ set(kritaexrimport_SOURCES
 
 add_library(kritaexrimport MODULE ${kritaexrimport_SOURCES})
 
-target_link_libraries(kritaexrimport kritaui kritalibkra ${OPENEXR_LIBRARIES} )
+target_link_libraries(kritaexrimport kritaui kritalibkra ${OpenEXR_LIBRARIES} )
 
 install(TARGETS kritaexrimport  DESTINATION ${KRITA_PLUGIN_INSTALL_DIR})
 
@@ -30,7 +30,7 @@ ki18n_wrap_ui(kritaexrexport_SOURCES exr_export_widget.ui )
 
 add_library(kritaexrexport MODULE ${kritaexrexport_SOURCES})
 
-target_link_libraries(kritaexrexport kritaui kritalibkra kritaimpex ${OPENEXR_LIBRARIES} )
+target_link_libraries(kritaexrexport kritaui kritalibkra kritaimpex ${OpenEXR_LIBRARIES} )
 
 install(TARGETS kritaexrexport  DESTINATION ${KRITA_PLUGIN_INSTALL_DIR})
 
diff --git a/plugins/impex/raw/CMakeLists.txt b/plugins/impex/raw/CMakeLists.txt
index 71cb5b355c..d20cbe63c5 100644
--- a/plugins/impex/raw/CMakeLists.txt
+++ b/plugins/impex/raw/CMakeLists.txt
@@ -1,7 +1,7 @@
 add_subdirectory(tests)
 
-if(OPENEXR_FOUND)
-	include_directories(${OPENEXR_INCLUDE_DIRS})
+if(OpenEXR_FOUND)
+	include_directories(${OpenEXR_INCLUDE_DIRS})
 endif()
 include_directories(${LibRaw_INCLUDE_DIR})
 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/libkdcraw/src)
-- 
2.26.0