Index: LuxCore-luxcorerender_v2.5/cmake/Dependencies.cmake
===================================================================
--- LuxCore-luxcorerender_v2.5.orig/cmake/Dependencies.cmake
+++ LuxCore-luxcorerender_v2.5/cmake/Dependencies.cmake
@@ -30,7 +30,14 @@ find_package(Threads REQUIRED)
find_package(OpenImageIO REQUIRED)
include_directories(BEFORE SYSTEM ${OPENIMAGEIO_INCLUDE_DIR})
-find_package(OpenEXR REQUIRED)
+
+# Try to use CMake targets first for OpenEXR 3.x
+find_package(Imath QUIET CONFIG)
+if(NOT TARGET Imath::Imath)
+ find_package(OpenEXR REQUIRED)
+else()
+ set(OPENEXR_LIBRARIES Imath::Imath)
+endif()
if(NOT APPLE)
# Apple has these available hardcoded and matched in macos repo, see Config_OSX.cmake
Index: LuxCore-luxcorerender_v2.5/deps/openvdb-7.0.0/openvdb/Types.h
===================================================================
--- LuxCore-luxcorerender_v2.5.orig/deps/openvdb-7.0.0/openvdb/Types.h
+++ LuxCore-luxcorerender_v2.5/deps/openvdb-7.0.0/openvdb/Types.h
@@ -6,7 +6,22 @@
#include "version.h"
#include "Platform.h"
-#include <OpenEXR/half.h>
+#include <OpenEXR/OpenEXRConfig.h>
+#define COMBINED_OPENEXR_VERSION ((10000*OPENEXR_VERSION_MAJOR) + \
+ (100*OPENEXR_VERSION_MINOR) + \
+ OPENEXR_VERSION_PATCH)
+
+// There's just no easy way to have an `#include` that works in both
+// cases, so we use the version to switch which set of include files we
+// use.
+#if COMBINED_OPENEXR_VERSION >= 20599 /* 2.5.99: pre-3.0 */
+# include <Imath/ImathVec.h>
+# include <Imath/half.h>
+#else
+ // OpenEXR 2.x, use the old locations
+# include <OpenEXR/ImathVec.h>
+# include <OpenEXR/half.h>
+#endif
#include <openvdb/math/Math.h>
#include <openvdb/math/BBox.h>
#include <openvdb/math/Quat.h>
Index: LuxCore-luxcorerender_v2.5/include/slg/imagemap/imagemap.h
===================================================================
--- LuxCore-luxcorerender_v2.5.orig/include/slg/imagemap/imagemap.h
+++ LuxCore-luxcorerender_v2.5/include/slg/imagemap/imagemap.h
@@ -19,7 +19,22 @@
#ifndef _SLG_IMAGEMAP_H
#define _SLG_IMAGEMAP_H
-#include <OpenEXR/half.h>
+#include <OpenEXR/OpenEXRConfig.h>
+#define COMBINED_OPENEXR_VERSION ((10000*OPENEXR_VERSION_MAJOR) + \
+ (100*OPENEXR_VERSION_MINOR) + \
+ OPENEXR_VERSION_PATCH)
+
+// There's just no easy way to have an `#include` that works in both
+// cases, so we use the version to switch which set of include files we
+// use.
+#if COMBINED_OPENEXR_VERSION >= 20599 /* 2.5.99: pre-3.0 */
+# include <Imath/ImathVec.h>
+# include <Imath/half.h>
+#else
+ // OpenEXR 2.x, use the old locations
+# include <OpenEXR/ImathVec.h>
+# include <OpenEXR/half.h>
+#endif
#include <string>
#include <limits>
Index: LuxCore-luxcorerender_v2.5/include/slg/utils/halfserialization.h
===================================================================
--- LuxCore-luxcorerender_v2.5.orig/include/slg/utils/halfserialization.h
+++ LuxCore-luxcorerender_v2.5/include/slg/utils/halfserialization.h
@@ -19,7 +19,22 @@
#ifndef _SLG_HALFSERIALIZATION_H
#define _SLG_HALFSERIALIZATION_H
-#include <OpenEXR/half.h>
+#include <OpenEXR/OpenEXRConfig.h>
+#define COMBINED_OPENEXR_VERSION ((10000*OPENEXR_VERSION_MAJOR) + \
+ (100*OPENEXR_VERSION_MINOR) + \
+ OPENEXR_VERSION_PATCH)
+
+// There's just no easy way to have an `#include` that works in both
+// cases, so we use the version to switch which set of include files we
+// use.
+#if COMBINED_OPENEXR_VERSION >= 20599 /* 2.5.99: pre-3.0 */
+# include <Imath/ImathVec.h>
+# include <Imath/half.h>
+#else
+ // OpenEXR 2.x, use the old locations
+# include <OpenEXR/ImathVec.h>
+# include <OpenEXR/half.h>
+#endif
#include "luxrays/utils/utils.h"
#include "luxrays/utils/serializationutils.h"
diff -up LuxCore-luxcorerender_v2.6/deps/opencolorio-2.0.0/src/OpenColorIO/MathUtils.h.orig LuxCore-luxcorerender_v2.6/deps/opencolorio-2.0.0/src/OpenColorIO/MathUtils.h
--- LuxCore-luxcorerender_v2.6/deps/opencolorio-2.0.0/src/OpenColorIO/MathUtils.h.orig 2021-12-25 12:07:24.000000000 +0100
+++ LuxCore-luxcorerender_v2.6/deps/opencolorio-2.0.0/src/OpenColorIO/MathUtils.h 2022-06-13 17:28:43.890815110 +0200
@@ -9,7 +9,22 @@
#include <OpenColorIO/OpenColorIO.h>
-#include "OpenEXR/half.h"
+#include <OpenEXR/OpenEXRConfig.h>
+#define COMBINED_OPENEXR_VERSION ((10000*OPENEXR_VERSION_MAJOR) + \
+ (100*OPENEXR_VERSION_MINOR) + \
+ OPENEXR_VERSION_PATCH)
+
+// There's just no easy way to have an `#include` that works in both
+// cases, so we use the version to switch which set of include files we
+// use.
+#if COMBINED_OPENEXR_VERSION >= 20599 /* 2.5.99: pre-3.0 */
+# include <Imath/ImathVec.h>
+# include <Imath/half.h>
+#else
+ // OpenEXR 2.x, use the old locations
+# include <OpenEXR/ImathVec.h>
+# include <OpenEXR/half.h>
+#endif
namespace OCIO_NAMESPACE
{
diff -up LuxCore-luxcorerender_v2.6/deps/opencolorio-2.0.0/src/OpenColorIO/BitDepthUtils.h.orig2 LuxCore-luxcorerender_v2.6/deps/opencolorio-2.0.0/src/OpenColorIO/BitDepthUtils.h
--- LuxCore-luxcorerender_v2.6/deps/opencolorio-2.0.0/src/OpenColorIO/BitDepthUtils.h.orig2 2021-12-25 12:07:24.000000000 +0100
+++ LuxCore-luxcorerender_v2.6/deps/opencolorio-2.0.0/src/OpenColorIO/BitDepthUtils.h 2022-06-13 17:32:41.224042246 +0200
@@ -7,7 +7,22 @@
#include <OpenColorIO/OpenColorIO.h>
-#include "OpenEXR/half.h"
+#include <OpenEXR/OpenEXRConfig.h>
+#define COMBINED_OPENEXR_VERSION ((10000*OPENEXR_VERSION_MAJOR) \
+ (100*OPENEXR_VERSION_MINOR) \
+ OPENEXR_VERSION_PATCH)
+
+// There's just no easy way to have an `#include` that works in both
+// cases, so we use the version to switch which set of include files we
+// use.
+#if COMBINED_OPENEXR_VERSION >= 20599 /* 2.5.99: pre-3.0 */
+# include <Imath/ImathVec.h>
+# include <Imath/half.h>
+#else
+ // OpenEXR 2.x, use the old locations
+# include <OpenEXR/ImathVec.h>
+# include <OpenEXR/half.h>
+#endif
namespace OCIO_NAMESPACE