Backport patch for OpenEXR

epel9
Nicolas Chauvet 5 years ago
parent b10a4597d0
commit 635cf81c73

@ -0,0 +1,89 @@
From fb3a334bbee3535d508af6510d9903d26ba37d34 Mon Sep 17 00:00:00 2001
From: h6197627 <aon70983@cndps.com>
Date: Mon, 6 Jan 2020 15:52:40 +0200
Subject: [PATCH] cmake: fix Linux system OpenEXR detection
---
cmake/OpenCVFindOpenEXR.cmake | 55 ++++++++++++++++++-----------------
1 file changed, 29 insertions(+), 26 deletions(-)
diff --git a/cmake/OpenCVFindOpenEXR.cmake b/cmake/OpenCVFindOpenEXR.cmake
index fb6c2fa1469..9103f1f5a71 100644
--- a/cmake/OpenCVFindOpenEXR.cmake
+++ b/cmake/OpenCVFindOpenEXR.cmake
@@ -20,6 +20,8 @@ if(WIN32)
elseif(MSVC)
SET(OPENEXR_LIBSEARCH_SUFFIXES Win32/Release Win32 Win32/Debug)
endif()
+elseif(UNIX)
+ SET(OPENEXR_LIBSEARCH_SUFFIXES ${CMAKE_LIBRARY_ARCHITECTURE})
endif()
SET(SEARCH_PATHS
@@ -39,6 +41,25 @@ MACRO(FIND_OPENEXR_LIBRARY LIBRARY_NAME LIBRARY_SUFFIX)
PATHS "${SEARCH_PATH}/lib" "${SEARCH_PATH}/lib/static")
ENDMACRO()
+MACRO(ocv_find_openexr LIBRARY_SUFFIX)
+ IF(NOT OPENEXR_FOUND)
+ FIND_OPENEXR_LIBRARY("Half" "${LIBRARY_SUFFIX}")
+ FIND_OPENEXR_LIBRARY("Iex" "${LIBRARY_SUFFIX}")
+ FIND_OPENEXR_LIBRARY("Imath" "${LIBRARY_SUFFIX}")
+ FIND_OPENEXR_LIBRARY("IlmImf" "${LIBRARY_SUFFIX}")
+ FIND_OPENEXR_LIBRARY("IlmThread" "${LIBRARY_SUFFIX}")
+ IF (OPENEXR_INCLUDE_PATH AND OPENEXR_IMATH_LIBRARY AND OPENEXR_ILMIMF_LIBRARY AND OPENEXR_IEX_LIBRARY AND OPENEXR_HALF_LIBRARY AND OPENEXR_ILMTHREAD_LIBRARY)
+ SET(OPENEXR_FOUND TRUE)
+ ELSE()
+ UNSET(OPENEXR_IMATH_LIBRARY)
+ UNSET(OPENEXR_ILMIMF_LIBRARY)
+ UNSET(OPENEXR_IEX_LIBRARY)
+ UNSET(OPENEXR_ILMTHREAD_LIBRARY)
+ UNSET(OPENEXR_HALF_LIBRARY)
+ ENDIF()
+ ENDIF()
+ENDMACRO()
+
FOREACH(SEARCH_PATH ${SEARCH_PATHS})
FIND_PATH(OPENEXR_INCLUDE_PATH ImfRgbaFile.h
PATH_SUFFIXES OpenEXR
@@ -64,32 +85,14 @@ FOREACH(SEARCH_PATH ${SEARCH_PATHS})
set(OPENEXR_VERSION "${OPENEXR_VERSION_MAJOR}_${OPENEXR_VERSION_MINOR}")
ENDIF ()
- SET(LIBRARY_SUFFIXES
- "-${OPENEXR_VERSION}"
- "-${OPENEXR_VERSION}_s"
- "-${OPENEXR_VERSION}_d"
- "-${OPEXEXR_VERSION}_s_d"
- ""
- "_s"
- "_d"
- "_s_d")
-
- FOREACH(LIBRARY_SUFFIX ${LIBRARY_SUFFIXES})
- FIND_OPENEXR_LIBRARY("Half" ${LIBRARY_SUFFIX})
- FIND_OPENEXR_LIBRARY("Iex" ${LIBRARY_SUFFIX})
- FIND_OPENEXR_LIBRARY("Imath" ${LIBRARY_SUFFIX})
- FIND_OPENEXR_LIBRARY("IlmImf" ${LIBRARY_SUFFIX})
- FIND_OPENEXR_LIBRARY("IlmThread" ${LIBRARY_SUFFIX})
- IF (OPENEXR_INCLUDE_PATH AND OPENEXR_IMATH_LIBRARY AND OPENEXR_ILMIMF_LIBRARY AND OPENEXR_IEX_LIBRARY AND OPENEXR_HALF_LIBRARY)
- SET(OPENEXR_FOUND TRUE)
- BREAK()
- ENDIF()
- UNSET(OPENEXR_IMATH_LIBRARY)
- UNSET(OPENEXR_ILMIMF_LIBRARY)
- UNSET(OPENEXR_IEX_LIBRARY)
- UNSET(OPENEXR_ILMTHREAD_LIBRARY)
- UNSET(OPENEXR_HALF_LIBRARY)
- ENDFOREACH()
+ ocv_find_openexr("-${OPENEXR_VERSION}")
+ ocv_find_openexr("-${OPENEXR_VERSION}_s")
+ ocv_find_openexr("-${OPENEXR_VERSION}_d")
+ ocv_find_openexr("-${OPEXEXR_VERSION}_s_d")
+ ocv_find_openexr("")
+ ocv_find_openexr("_s")
+ ocv_find_openexr("_d")
+ ocv_find_openexr("_s_d")
IF (OPENEXR_FOUND)
BREAK()

@ -76,6 +76,7 @@ Source3: face_landmark_model.dat.xz
Source4: b624b995ec9c439cbc2e9e6ee940d3a2-v0.1.1f.zip
Patch0: opencv-4.1.0-install_3rdparty_licenses.patch
Patch1: https://github.com/opencv/opencv/commit/fb3a334bbee3535d508af6510d9903d26ba37d34.patch
BuildRequires: gcc-c++
BuildRequires: libtool
@ -251,6 +252,7 @@ popd &>/dev/null
%endif
%patch0 -p1 -b .install_3rdparty_licenses
%patch1 -p1
pushd %{name}_contrib-%{version}
popd

Loading…
Cancel
Save