aboutsummaryrefslogtreecommitdiff
path: root/ports/openimageio
diff options
context:
space:
mode:
authorChao <6785880+ChaoJia@users.noreply.github.com>2019-09-29 22:07:50 +0200
committerCurtis J Bezault <curtbezault@gmail.com>2019-09-29 13:07:50 -0700
commitb9c87f40d487c63d64b384f494da050acd309ce8 (patch)
tree0a38ce32dcd2e27c8792b4dd60239ea78a210568 /ports/openimageio
parent3c39089dadbf057b938c228932e39a76b1fbece7 (diff)
downloadvcpkg-b9c87f40d487c63d64b384f494da050acd309ce8.tar.gz
vcpkg-b9c87f40d487c63d64b384f494da050acd309ce8.zip
[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;
Diffstat (limited to 'ports/openimageio')
-rw-r--r--ports/openimageio/fix_find_openexr.patch53
-rw-r--r--ports/openimageio/portfile.cmake6
-rw-r--r--ports/openimageio/use-vcpkg-find-openexr.patch27
3 files changed, 32 insertions, 54 deletions
diff --git a/ports/openimageio/fix_find_openexr.patch b/ports/openimageio/fix_find_openexr.patch
deleted file mode 100644
index f9bc401d9..000000000
--- a/ports/openimageio/fix_find_openexr.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-diff --git a/src/cmake/modules/FindOpenEXR.cmake b/src/cmake/modules/FindOpenEXR.cmake
-index babfffd..3d0bee3 100644
---- a/src/cmake/modules/FindOpenEXR.cmake
-+++ b/src/cmake/modules/FindOpenEXR.cmake
-@@ -118,24 +118,30 @@ endif ()
- # headers, we do two finds -- first for custom locations, then for default.
- # This is complicated because the OpenEXR libraries may or may not be
- # built with version numbers embedded.
--set (_openexr_components IlmThread IlmImf Imath Iex Half)
--foreach (COMPONENT ${_openexr_components})
-- string (TOUPPER ${COMPONENT} UPPERCOMPONENT)
-- # First try with the version embedded
-- set (FULL_COMPONENT_NAME ${COMPONENT}-${OPENEXR_VERSION_MAJOR}_${OPENEXR_VERSION_MINOR})
-- find_library (OPENEXR_${UPPERCOMPONENT}_LIBRARY ${FULL_COMPONENT_NAME}
-- PATHS ${OPENEXR_LIBRARY_DIR} $ENV{OPENEXR_LIBRARY_DIR}
-- ${GENERIC_LIBRARY_PATHS} NO_DEFAULT_PATH)
-- # Again, with no directory restrictions
-- find_library (OPENEXR_${UPPERCOMPONENT}_LIBRARY ${FULL_COMPONENT_NAME})
-- # Try again without the version
-- set (FULL_COMPONENT_NAME ${COMPONENT})
-- find_library (OPENEXR_${UPPERCOMPONENT}_LIBRARY ${FULL_COMPONENT_NAME}
-- PATHS ${OPENEXR_LIBRARY_DIR} $ENV{OPENEXR_LIBRARY_DIR}
-- ${GENERIC_LIBRARY_PATHS} NO_DEFAULT_PATH)
-- # One more time, with no restrictions
-- find_library (OPENEXR_${UPPERCOMPONENT}_LIBRARY ${FULL_COMPONENT_NAME})
--endforeach ()
-+if (WIN32)
-+ set(OPENEXR_DEBUG_SUFFIX "_d")
-+else()
-+ set(OPENEXR_DEBUG_SUFFIX "")
-+endif()
-+find_library(ILMTHREAD_LIBRARY_RELEASE NAMES IlmThread-${OPENEXR_VERSION_MAJOR}_${OPENEXR_VERSION_MINOR})
-+find_library(ILMTHREAD_LIBRARY_DEBUG NAMES IlmThread-${OPENEXR_VERSION_MAJOR}_${OPENEXR_VERSION_MINOR}${OPENEXR_DEBUG_SUFFIX})
-+select_library_configurations(ILMTHREAD)
-+
-+find_library(OPENEXR_ILMIMF_LIBRARY_RELEASE NAMES IlmImf-${OPENEXR_VERSION_MAJOR}_${OPENEXR_VERSION_MINOR})
-+find_library(OPENEXR_ILMIMF_LIBRARY_DEBUG NAMES IlmImf-${OPENEXR_VERSION_MAJOR}_${OPENEXR_VERSION_MINOR}${OPENEXR_DEBUG_SUFFIX})
-+select_library_configurations(OPENEXR_ILMIMF)
-+
-+find_library(OPENEXR_IMATH_LIBRARY_RELEASE NAMES Imath-${OPENEXR_VERSION_MAJOR}_${OPENEXR_VERSION_MINOR})
-+find_library(OPENEXR_IMATH_LIBRARY_DEBUG NAMES Imath-${OPENEXR_VERSION_MAJOR}_${OPENEXR_VERSION_MINOR}${OPENEXR_DEBUG_SUFFIX})
-+select_library_configurations(OPENEXR_IMATH)
-+
-+find_library(OPENEXR_IEX_LIBRARY_RELEASE NAMES Iex-${OPENEXR_VERSION_MAJOR}_${OPENEXR_VERSION_MINOR})
-+find_library(OPENEXR_IEX_LIBRARY_DEBUG NAMES Iex-${OPENEXR_VERSION_MAJOR}_${OPENEXR_VERSION_MINOR}${OPENEXR_DEBUG_SUFFIX})
-+select_library_configurations(OPENEXR_IEX)
-+
-+find_library(OPENEXR_HALF_LIBRARY_RELEASE NAMES Half-${OPENEXR_VERSION_MAJOR}_${OPENEXR_VERSION_MINOR})
-+find_library(OPENEXR_HALF_LIBRARY_DEBUG NAMES Half-${OPENEXR_VERSION_MAJOR}_${OPENEXR_VERSION_MINOR}${OPENEXR_DEBUG_SUFFIX})
-+select_library_configurations(OPENEXR_HALF)
-
- # Set the FOUND, INCLUDE_DIR, and LIBRARIES variables.
- if (ILMBASE_INCLUDE_PATH AND OPENEXR_INCLUDE_PATH AND
diff --git a/ports/openimageio/portfile.cmake b/ports/openimageio/portfile.cmake
index 6d14e580c..aeccf0bc0 100644
--- a/ports/openimageio/portfile.cmake
+++ b/ports/openimageio/portfile.cmake
@@ -10,10 +10,14 @@ vcpkg_from_github(
fix_libraw.patch
use-webp.patch
remove_wrong_dependency.patch
- fix_find_openexr.patch
+ use-vcpkg-find-openexr.patch
)
file(REMOVE_RECURSE "${SOURCE_PATH}/ext")
+
+file(REMOVE "${SOURCE_PATH}/src/cmake/modules/FindLibRaw.cmake")
+file(REMOVE "${SOURCE_PATH}/src/cmake/modules/FindOpenEXR.cmake")
+
file(MAKE_DIRECTORY "${SOURCE_PATH}/ext/robin-map/tsl")
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
diff --git a/ports/openimageio/use-vcpkg-find-openexr.patch b/ports/openimageio/use-vcpkg-find-openexr.patch
new file mode 100644
index 000000000..bacc4f686
--- /dev/null
+++ b/ports/openimageio/use-vcpkg-find-openexr.patch
@@ -0,0 +1,27 @@
+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}")