Support building with OpenEXR 3.x
* Support OpenEXR 3.0
Try to find OpenEXR 3.0 using the upstream cmake config, and fallback to the previous algorithm if not found
* Add explicit ImfFrameBuffer.h include
This was transitively included with OpenEXR 2.x, but that's no longer the case with OpenEXR 3.x
# OPENEXR_LIBRARIES = libraries that are needed to use OpenEXR.
#
+find_package(OpenEXR 3.0 CONFIG QUIET)
+if(TARGET OpenEXR::OpenEXR)
+ SET(OPENEXR_FOUND TRUE)
+ SET(OPENEXR_LIBRARIES OpenEXR::OpenEXR)
+ SET(OPENEXR_VERSION ${OpenEXR_VERSION})
+ return()
+endif()
+
SET(OPENEXR_LIBRARIES "")
SET(OPENEXR_LIBSEARCH_SUFFIXES "")
file(TO_CMAKE_PATH "$ENV{ProgramFiles}" ProgramFiles_ENV_PATH)
#include <iostream>
#include <stdexcept>
+#include <ImfFrameBuffer.h>
#include <ImfHeader.h>
#include <ImfInputFile.h>
#include <ImfOutputFile.h>