Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / opencv / cmake-don-t-use-OpenCVFindOpenEXR.patch
blobabeb0d9fde4b4ad758d65da232a95a04b37b2269
1 diff --git a/cmake/OpenCVFindLibsGrfmt.cmake b/cmake/OpenCVFindLibsGrfmt.cmake
2 index 00886cc131..e412771322 100644
3 --- a/cmake/OpenCVFindLibsGrfmt.cmake
4 +++ b/cmake/OpenCVFindLibsGrfmt.cmake
5 @@ -257,23 +257,12 @@ endif()
6 # --- OpenEXR (optional) ---
7 if(WITH_OPENEXR)
8 ocv_clear_vars(HAVE_OPENEXR)
9 - if(NOT BUILD_OPENEXR)
10 - ocv_clear_internal_cache_vars(OPENEXR_INCLUDE_PATHS OPENEXR_LIBRARIES OPENEXR_ILMIMF_LIBRARY OPENEXR_VERSION)
11 - include("${OpenCV_SOURCE_DIR}/cmake/OpenCVFindOpenEXR.cmake")
12 - endif()
13 + pkg_check_modules(OPENEXR OpenEXR)
15 if(OPENEXR_FOUND)
16 set(HAVE_OPENEXR YES)
17 - else()
18 - ocv_clear_vars(OPENEXR_INCLUDE_PATHS OPENEXR_LIBRARIES OPENEXR_ILMIMF_LIBRARY OPENEXR_VERSION)
20 - set(OPENEXR_LIBRARIES IlmImf)
21 - add_subdirectory("${OpenCV_SOURCE_DIR}/3rdparty/openexr")
22 - if(OPENEXR_VERSION) # check via TARGET doesn't work
23 - set(BUILD_OPENEXR ON)
24 - set(HAVE_OPENEXR YES)
25 - set(BUILD_OPENEXR ON)
26 - endif()
27 + set(OPENEXR_INCLUDE_PATHS ${OPENEXR_INCLUDE_DIRS})
28 + set(OPENEXR_LIBRARIES ${OPENEXR_LIBRARIES})
29 endif()
30 endif()