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 +#include +#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 +# include +#else + // OpenEXR 2.x, use the old locations +# include +# include +#endif #include #include #include 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 +#include +#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 +# include +#else + // OpenEXR 2.x, use the old locations +# include +# include +#endif #include #include 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 +#include +#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 +# include +#else + // OpenEXR 2.x, use the old locations +# include +# include +#endif #include "luxrays/utils/utils.h" #include "luxrays/utils/serializationutils.h"