vcpkg/ports/openimageio/use-vcpkg-find-openexr.patch
Chao b9c87f40d4 [alembic,geogram,openimageio]: alembic: in favor of FindOpenEXR.cmake installed alongside package openexr by vcpkg so that debug version of openexr can actually be found and linked into; (#8379)
geogram: remove /src/lib from INTERFACE_INCLUDE_DIRECTORIES in GeogramTargets.cmake, as /src/lib is not a valid include path;
openimageio: in favor of FindOpenEXR.cmake and LibRaw-config.cmake installed by vcpkg so that the debug version of openexr and libraw can actually be found and linked into;
2019-09-29 13:07:50 -07:00

28 lines
1.3 KiB
Diff

diff --git a/src/cmake/externalpackages.cmake b/src/cmake/externalpackages.cmake
index 7ebc1cf..a920c72 100644
--- a/src/cmake/externalpackages.cmake
+++ b/src/cmake/externalpackages.cmake
@@ -64,12 +64,19 @@ find_package (PNG REQUIRED)
###########################################################################
# IlmBase & OpenEXR setup
+find_package (Threads)
+if (CMAKE_USE_PTHREADS_INIT)
+ set (ILMBASE_PTHREADS ${CMAKE_THREAD_LIBS_INIT})
+endif ()
+
find_package (OpenEXR 2.0 REQUIRED)
#OpenEXR 2.2 still has problems with importing ImathInt64.h unqualified
#thus need for ilmbase/OpenEXR
-include_directories ("${OPENEXR_INCLUDE_DIR}"
- "${ILMBASE_INCLUDE_DIR}"
- "${ILMBASE_INCLUDE_DIR}/OpenEXR")
+set(ILMBASE_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} ${OPENEXR_ILMTHREAD_LIBRARY} ${ILMBASE_PTHREADS} CACHE STRING "The libraries needed to use IlmBase")
+set(OPENEXR_LIBRARIES ${OPENEXR_ILMIMF_LIBRARY} ${ILMBASE_LIBRARIES} CACHE STRING "The libraries needed to use OpenEXR")
+set(ILMBASE_INCLUDE_DIR ${OPENEXR_INCLUDE_DIR})
+set(ILMBASE_FOUND TRUE)
+include_directories ("${OPENEXR_INCLUDE_DIR}")
if (NOT OpenEXR_FIND_QUIETLY)
message (STATUS "OPENEXR_INCLUDE_DIR = ${OPENEXR_INCLUDE_DIR}")
message (STATUS "OPENEXR_LIBRARIES = ${OPENEXR_LIBRARIES}")