]> git.pld-linux.org Git - packages/Field3D.git/blob - openexr3.patch
- update deps for ilmbase obsolescence, rel 6
[packages/Field3D.git] / openexr3.patch
1 Index: Field3D-1.7.3/export/StdMathLib.h
2 ===================================================================
3 --- Field3D-1.7.3.orig/export/StdMathLib.h
4 +++ Field3D-1.7.3/export/StdMathLib.h
5 @@ -38,18 +38,41 @@
6  #ifndef _INCLUDED_Field3D_StdMathLib_H_
7  #define _INCLUDED_Field3D_StdMathLib_H_
8  
9 -#include <OpenEXR/ImathBox.h> 
10 -#include <OpenEXR/ImathBoxAlgo.h>
11 -#include <OpenEXR/ImathColor.h>
12 -#include <OpenEXR/ImathHalfLimits.h>
13 -#include <OpenEXR/ImathMatrix.h>
14 -#include <OpenEXR/ImathMatrixAlgo.h>
15 -#include <OpenEXR/ImathPlane.h>
16 -#include <OpenEXR/ImathRandom.h> 
17 -#include <OpenEXR/ImathRoots.h>
18 -#include <OpenEXR/ImathVec.h>
19 -#include <OpenEXR/half.h> 
20 +// The version can reliably be found in this header file from OpenEXR,
21 +// for both 2.x and 3.x:
22 +#include <OpenEXR/OpenEXRConfig.h>
23 +#define COMBINED_OPENEXR_VERSION ((10000*OPENEXR_VERSION_MAJOR) + \
24 +                                  (100*OPENEXR_VERSION_MINOR) + \
25 +                                  OPENEXR_VERSION_PATCH)
26  
27 +// There's just no easy way to have an `#include` that works in both
28 +// cases, so we use the version to switch which set of include files we
29 +// use.
30 +#if COMBINED_OPENEXR_VERSION >= 20599 /* 2.5.99: pre-3.0 */
31 +#   include <Imath/ImathBox.h>
32 +#   include <Imath/ImathBoxAlgo.h>
33 +#   include <Imath/ImathColor.h>
34 +#   include <Imath/ImathMatrix.h>
35 +#   include <Imath/ImathMatrixAlgo.h>
36 +#   include <Imath/ImathPlane.h>
37 +#   include <Imath/ImathRandom.h>
38 +#   include <Imath/ImathRoots.h>
39 +#   include <Imath/ImathVec.h>
40 +#   include <Imath/half.h>
41 +#else
42 +    // OpenEXR 2.x, use the old locations
43 +#   include <OpenEXR/ImathBox.h>
44 +#   include <OpenEXR/ImathBoxAlgo.h>
45 +#   include <OpenEXR/ImathColor.h>
46 +#   include <OpenEXR/ImathHalfLimits.h>
47 +#   include <OpenEXR/ImathMatrix.h>
48 +#   include <OpenEXR/ImathMatrixAlgo.h>
49 +#   include <OpenEXR/ImathPlane.h>
50 +#   include <OpenEXR/ImathRandom.h>
51 +#   include <OpenEXR/ImathRoots.h>
52 +#   include <OpenEXR/ImathVec.h>
53 +#   include <OpenEXR/half.h>
54 +#endif
55  //----------------------------------------------------------------------------//
56  
57  #include "ns.h"
58 Index: Field3D-1.7.3/export/Curve.h
59 ===================================================================
60 --- Field3D-1.7.3.orig/export/Curve.h
61 +++ Field3D-1.7.3/export/Curve.h
62 @@ -53,8 +53,25 @@
63  
64  #include <boost/lexical_cast.hpp>
65  
66 -#include <OpenEXR/ImathFun.h>
67 -#include <OpenEXR/ImathMatrix.h>
68 +// The version can reliably be found in this header file from OpenEXR,
69 +// for both 2.x and 3.x:
70 +#include <OpenEXR/OpenEXRConfig.h>
71 +#define COMBINED_OPENEXR_VERSION ((10000*OPENEXR_VERSION_MAJOR) + \
72 +                                  (100*OPENEXR_VERSION_MINOR) + \
73 +                                  OPENEXR_VERSION_PATCH)
74 +
75 +// There's just no easy way to have an `#include` that works in both
76 +// cases, so we use the version to switch which set of include files we
77 +// use.
78 +#if COMBINED_OPENEXR_VERSION >= 20599 /* 2.5.99: pre-3.0 */
79 +#   include <Imath/ImathFun.h>
80 +#   include <Imath/ImathMatrix.h>
81 +#else
82 +    // OpenEXR 2.x, use the old locations
83 +#   include <OpenEXR/ImathFun.h>
84 +#   include <OpenEXR/ImathMatrix.h>
85 +#endif
86 +
87  
88  //----------------------------------------------------------------------------//
89  
90 Index: Field3D-1.7.3/include/OgUtil.h
91 ===================================================================
92 --- Field3D-1.7.3.orig/include/OgUtil.h
93 +++ Field3D-1.7.3/include/OgUtil.h
94 @@ -10,7 +10,22 @@
95  #include <iostream>
96  #include <string>
97  
98 -#include <OpenEXR/ImathVec.h>
99 +// The version can reliably be found in this header file from OpenEXR,
100 +// for both 2.x and 3.x:
101 +#include <OpenEXR/OpenEXRConfig.h>
102 +#define COMBINED_OPENEXR_VERSION ((10000*OPENEXR_VERSION_MAJOR) + \
103 +                                  (100*OPENEXR_VERSION_MINOR) + \
104 +                                  OPENEXR_VERSION_PATCH)
105 +
106 +// There's just no easy way to have an `#include` that works in both
107 +// cases, so we use the version to switch which set of include files we
108 +// use.
109 +#if COMBINED_OPENEXR_VERSION >= 20599 /* 2.5.99: pre-3.0 */
110 +#   include <Imath/ImathVec.h>
111 +#else
112 +    // OpenEXR 2.x, use the old locations
113 +#   include <OpenEXR/ImathVec.h>
114 +#endif
115  
116  #include "All.h"
117  #include "UtilFoundation.h"
118 Index: Field3D-1.7.3/include/UtilFoundation.h
119 ===================================================================
120 --- Field3D-1.7.3.orig/include/UtilFoundation.h
121 +++ Field3D-1.7.3/include/UtilFoundation.h
122 @@ -68,7 +68,22 @@
123  
124  #include <memory>
125  
126 -#include <half.h>
127 +// The version can reliably be found in this header file from OpenEXR,
128 +// for both 2.x and 3.x:
129 +#include <OpenEXR/OpenEXRConfig.h>
130 +#define COMBINED_OPENEXR_VERSION ((10000*OPENEXR_VERSION_MAJOR) + \
131 +                                  (100*OPENEXR_VERSION_MINOR) + \
132 +                                  OPENEXR_VERSION_PATCH)
133 +
134 +// There's just no easy way to have an `#include` that works in both
135 +// cases, so we use the version to switch which set of include files we
136 +// use.
137 +#if COMBINED_OPENEXR_VERSION >= 20599 /* 2.5.99: pre-3.0 */
138 +#   include <Imath/half.h>
139 +#else
140 +    // OpenEXR 2.x, use the old locations
141 +#   include <OpenEXR/half.h>
142 +#endif
143  
144  #include <iomanip>
145  #include <iostream>
146 Index: Field3D-1.7.3/include/OgIAttribute.h
147 ===================================================================
148 --- Field3D-1.7.3.orig/include/OgIAttribute.h
149 +++ Field3D-1.7.3/include/OgIAttribute.h
150 @@ -9,7 +9,22 @@
151  
152  #include "OgUtil.h"
153  
154 -#include <OpenEXR/ImathMatrix.h>
155 +// The version can reliably be found in this header file from OpenEXR,
156 +// for both 2.x and 3.x:
157 +#include <OpenEXR/OpenEXRConfig.h>
158 +#define COMBINED_OPENEXR_VERSION ((10000*OPENEXR_VERSION_MAJOR) + \
159 +                                  (100*OPENEXR_VERSION_MINOR) + \
160 +                                  OPENEXR_VERSION_PATCH)
161 +
162 +// There's just no easy way to have an `#include` that works in both
163 +// cases, so we use the version to switch which set of include files we
164 +// use.
165 +#if COMBINED_OPENEXR_VERSION >= 20599 /* 2.5.99: pre-3.0 */
166 +#   include <Imath/ImathMatrix.h>
167 +#else
168 +    // OpenEXR 2.x, use the old locations
169 +#   include <OpenEXR/ImathMatrix.h>
170 +#endif
171  
172  //----------------------------------------------------------------------------//
173  
174 Index: Field3D-1.7.3/CMakeLists.txt
175 ===================================================================
176 --- Field3D-1.7.3.orig/CMakeLists.txt
177 +++ Field3D-1.7.3/CMakeLists.txt
178 @@ -38,7 +38,6 @@
179  set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake )
180  
181  FIND_PACKAGE (Doxygen)
182 -FIND_PACKAGE (HDF5 COMPONENTS C)
183  IF ( CMAKE_HOST_WIN32 )
184  # f3dinfo relies on program_options but don't include it, since
185  # for some reason, unlike all the other boost components, a link is
186 @@ -49,7 +49,14 @@ FIND_PACKAGE (Boost COMPONENTS regex thr
187  FIND_PACKAGE (MPI)
188  ENDIF ()
189  
190 -FIND_PACKAGE (ILMBase)
191 +# First, try to find just the right config files
192 +find_package(Imath CONFIG)
193 +if (NOT TARGET Imath::Imath)
194 +    # Couldn't find Imath::Imath, maybe it's older and has IlmBase?
195 +    find_package(IlmBase CONFIG)
196 +endif ()
197 +find_package(OpenEXR CONFIG)
198 +find_package(HDF5 COMPONENTS C)
199  
200  # Allow the developer to select if Dynamic or Static libraries are built
201  OPTION (BUILD_SHARED_LIBS "Build Shared Libraries" ON)
202 @@ -146,9 +152,20 @@ IF ( CMAKE_HOST_UNIX )
203        LIST ( APPEND Field3D_Libraries_Shared
204               ${MPI_LIBRARIES} )
205    ENDIF ( MPI_FOUND )
206 -  LIST ( APPEND Field3D_Libraries_Shared
207 -    Iex Half IlmThread Imath
208 -    pthread dl z )
209 +  if(TARGET Imath::Imath)
210 +         list(APPEND Field3D_Libraries_Shared
211 +        # For OpenEXR/Imath 3.x:
212 +          $<$<TARGET_EXISTS:OpenEXR::OpenEXR>:OpenEXR::OpenEXR>
213 +          $<$<TARGET_EXISTS:Imath::Imath>:Imath::Imath>
214 +          $<$<TARGET_EXISTS:Imath::Half>:Imath::Half>
215 +                 pthread
216 +                 dl
217 +                 z)
218 +  else()
219 +    LIST ( APPEND Field3D_Libraries_Shared
220 +        Iex Half IlmThread Imath
221 +        pthread dl z )
222 +  endif()
223    SET ( Field3D_DSO_Libraries ${Field3D_Libraries_Shared} )
224    SET ( Field3D_BIN_Libraries Field3D ${Field3D_Libraries_Shared}
225          ${Boost_LIBRARIES} )
226 Index: Field3D-1.7.3/test/unit_tests/UnitTest.cpp
227 ===================================================================
228 --- Field3D-1.7.3.orig/test/unit_tests/UnitTest.cpp
229 +++ Field3D-1.7.3/test/unit_tests/UnitTest.cpp
230 @@ -44,7 +44,22 @@
231  #include <boost/thread/thread.hpp>
232  #include <boost/thread/mutex.hpp>
233  
234 -#include <OpenEXR/ImathFrustum.h>
235 +// The version can reliably be found in this header file from OpenEXR,
236 +// for both 2.x and 3.x:
237 +#include <OpenEXR/OpenEXRConfig.h>
238 +#define COMBINED_OPENEXR_VERSION ((10000*OPENEXR_VERSION_MAJOR) + \
239 +                                  (100*OPENEXR_VERSION_MINOR) + \
240 +                                  OPENEXR_VERSION_PATCH)
241 +
242 +// There's just no easy way to have an `#include` that works in both
243 +// cases, so we use the version to switch which set of include files we
244 +// use.
245 +#if COMBINED_OPENEXR_VERSION >= 20599 /* 2.5.99: pre-3.0 */
246 +#   include <Imath/ImathFrustum.h>
247 +#else
248 +    // OpenEXR 2.x, use the old locations
249 +#   include <OpenEXR/ImathFrustum.h>
250 +#endif
251  
252  #include "Field3D/DenseField.h"
253  #include "Field3D/EmptyField.h"
This page took 0.045707 seconds and 3 git commands to generate.