depot/third_party/nixpkgs/pkgs/development/libraries/opencv/cmake-don-t-use-OpenCVFindOpenEXR.patch

32 lines
1.1 KiB
Diff
Raw Normal View History

diff --git a/cmake/OpenCVFindLibsGrfmt.cmake b/cmake/OpenCVFindLibsGrfmt.cmake
index 00886cc131..e412771322 100644
--- a/cmake/OpenCVFindLibsGrfmt.cmake
+++ b/cmake/OpenCVFindLibsGrfmt.cmake
@@ -257,23 +257,12 @@ endif()
# --- OpenEXR (optional) ---
if(WITH_OPENEXR)
ocv_clear_vars(HAVE_OPENEXR)
- if(NOT BUILD_OPENEXR)
- ocv_clear_internal_cache_vars(OPENEXR_INCLUDE_PATHS OPENEXR_LIBRARIES OPENEXR_ILMIMF_LIBRARY OPENEXR_VERSION)
- include("${OpenCV_SOURCE_DIR}/cmake/OpenCVFindOpenEXR.cmake")
- endif()
+ pkg_check_modules(OPENEXR OpenEXR)
if(OPENEXR_FOUND)
set(HAVE_OPENEXR YES)
- else()
- ocv_clear_vars(OPENEXR_INCLUDE_PATHS OPENEXR_LIBRARIES OPENEXR_ILMIMF_LIBRARY OPENEXR_VERSION)
-
- set(OPENEXR_LIBRARIES IlmImf)
- add_subdirectory("${OpenCV_SOURCE_DIR}/3rdparty/openexr")
- if(OPENEXR_VERSION) # check via TARGET doesn't work
- set(BUILD_OPENEXR ON)
- set(HAVE_OPENEXR YES)
- set(BUILD_OPENEXR ON)
- endif()
+ set(OPENEXR_INCLUDE_PATHS ${OPENEXR_INCLUDE_DIRS})
+ set(OPENEXR_LIBRARIES ${OPENEXR_LIBRARIES})
endif()
endif()