From: Antonio Rojas Date: Mon, 26 Apr 2021 22:13:59 +0000 (+0200) Subject: Merge pull request #19970 from antonio-rojas:master X-Git-Tag: submit/tizen/20220120.021815~1^2~96 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=971dacaf41941eddf67c6cba8f966edf16d1386e;p=platform%2Fupstream%2Fopencv.git Merge pull request #19970 from antonio-rojas:master 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 --- diff --git a/cmake/OpenCVFindOpenEXR.cmake b/cmake/OpenCVFindOpenEXR.cmake index ef633e853a..133468243a 100644 --- a/cmake/OpenCVFindOpenEXR.cmake +++ b/cmake/OpenCVFindOpenEXR.cmake @@ -9,6 +9,14 @@ # 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) diff --git a/modules/imgcodecs/src/grfmt_exr.cpp b/modules/imgcodecs/src/grfmt_exr.cpp index 9242871f8d..aaf28eead6 100644 --- a/modules/imgcodecs/src/grfmt_exr.cpp +++ b/modules/imgcodecs/src/grfmt_exr.cpp @@ -56,6 +56,7 @@ #include #include +#include #include #include #include