[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;
This commit is contained in:
Chao 2019-09-29 22:07:50 +02:00 committed by Curtis J Bezault
parent 3c39089dad
commit b9c87f40d4
6 changed files with 419 additions and 54 deletions

View File

@ -0,0 +1,381 @@
diff --git a/cmake/AlembicIlmBase.cmake b/cmake/AlembicIlmBase.cmake
index cd00d70..a73c8db 100644
--- a/cmake/AlembicIlmBase.cmake
+++ b/cmake/AlembicIlmBase.cmake
@@ -33,11 +33,25 @@
##
##-*****************************************************************************
-FIND_PACKAGE(IlmBase)
+FIND_PACKAGE(OpenEXR)
-IF (ILMBASE_FOUND)
+IF (OPENEXR_FOUND)
SET(ALEMBIC_ILMBASE_FOUND 1 CACHE STRING "Set to 1 if IlmBase is found, 0 otherwise")
+ set(ALEMBIC_ILMBASE_INCLUDE_DIRECTORY ${OpenEXR_INCLUDE_DIRS}/OpenEXR)
+ set(ALEMBIC_ILMBASE_HALF_LIB ${OPENEXR_HALF_LIBRARY})
+ set(ALEMBIC_ILMBASE_IEX_LIB ${OPENEXR_IEX_LIBRARY})
+ set(ALEMBIC_ILMBASE_IEXMATH_LIB ${OpenEXR_IEXMATH_LIBRARY})
+ set(ALEMBIC_ILMBASE_ILMTHREAD_LIB ${OPENEXR_ILMTHREAD_LIBRARY})
+ set(ALEMBIC_ILMBASE_IMATH_LIB ${OPENEXR_IMATH_LIBRARY})
+
+ MESSAGE( STATUS "ILMBASE INCLUDE PATH: ${ALEMBIC_ILMBASE_INCLUDE_DIRECTORY}" )
+ MESSAGE( STATUS "HALF LIB: ${ALEMBIC_ILMBASE_HALF_LIB}" )
+ MESSAGE( STATUS "IEX LIB: ${ALEMBIC_ILMBASE_IEX_LIB}" )
+ MESSAGE( STATUS "IEXMATH LIB: ${ALEMBIC_ILMBASE_IEXMATH_LIB}" )
+ MESSAGE( STATUS "ILMTHREAD LIB: ${ALEMBIC_ILMBASE_ILMTHREAD_LIB}" )
+ MESSAGE( STATUS "IMATH LIB: ${ALEMBIC_ILMBASE_IMATH_LIB}" )
+
SET(ALEMBIC_ILMBASE_LIBS
${ALEMBIC_ILMBASE_IMATH_LIB}
${ALEMBIC_ILMBASE_ILMTHREAD_LIB}
diff --git a/cmake/AlembicOpenEXR.cmake b/cmake/AlembicOpenEXR.cmake
index 0833b32..a9180cd 100644
--- a/cmake/AlembicOpenEXR.cmake
+++ b/cmake/AlembicOpenEXR.cmake
@@ -38,8 +38,12 @@
FIND_PACKAGE( OpenEXR )
IF( OPENEXR_FOUND )
- SET( ALEMBIC_OPENEXR_INCLUDE_PATH ${OPENEXR_INCLUDE_PATHS} )
+ SET( ALEMBIC_OPENEXR_INCLUDE_PATH ${OPENEXR_INCLUDE_PATHS}/OpenEXR )
SET( ALEMBIC_OPENEXR_LIBRARIES ${OPENEXR_LIBRARIES} )
+
+ MESSAGE( STATUS "OPENEXR INCLUDE PATH: ${ALEMBIC_OPENEXR_INCLUDE_PATH}" )
+ MESSAGE( STATUS "OPENEXR LIB: ${ALEMBIC_OPENEXR_LIBRARIES}" )
+
# SET( ALEMBIC_OPENEXR_DEFINITIONS ${OPENEXR_DEFINITIONS} )
SET( ALEMBIC_OPENEXR_FOUND 1 CACHE STRING "Set to 1 if OpenEXR is found, 0 otherwise" )
diff --git a/cmake/Modules/FindIlmBase.cmake b/cmake/Modules/FindIlmBase.cmake
deleted file mode 100644
index 679a02f..0000000
--- a/cmake/Modules/FindIlmBase.cmake
+++ /dev/null
@@ -1,190 +0,0 @@
-##-*****************************************************************************
-##
-## Copyright (c) 2009-2016,
-## Sony Pictures Imageworks Inc. and
-## Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd.
-##
-## All rights reserved.
-##
-## Redistribution and use in source and binary forms, with or without
-## modification, are permitted provided that the following conditions are
-## met:
-## * Redistributions of source code must retain the above copyright
-## notice, this list of conditions and the following disclaimer.
-## * Redistributions in binary form must reproduce the above
-## copyright notice, this list of conditions and the following disclaimer
-## in the documentation and/or other materials provided with the
-## distribution.
-## * Neither the name of Industrial Light & Magic nor the names of
-## its contributors may be used to endorse or promote products derived
-## from this software without specific prior written permission.
-##
-## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-##
-##-*****************************************************************************
-
-#-******************************************************************************
-#-******************************************************************************
-# FIRST, ILMBASE STUFF
-#-******************************************************************************
-#-******************************************************************************
-
-# If ILMBASE_ROOT was defined in the environment, use it.
-IF(NOT ILMBASE_ROOT AND NOT $ENV{ILMBASE_ROOT} STREQUAL "")
- SET(ILMBASE_ROOT $ENV{ILMBASE_ROOT})
-ENDIF()
-
-IF(NOT DEFINED ILMBASE_ROOT)
- MESSAGE(STATUS "ILMBASE_ROOT is undefined" )
- IF ( ${CMAKE_HOST_UNIX} )
- IF( ${DARWIN} )
- # TODO: set to default install path when shipping out
- SET( ALEMBIC_ILMBASE_ROOT NOTFOUND )
- ELSE()
- # TODO: set to default install path when shipping out
- SET( ALEMBIC_ILMBASE_ROOT "/usr/local/ilmbase-1.0.1/" )
- ENDIF()
- ELSE()
- IF ( ${WINDOWS} )
- # TODO: set to 32-bit or 64-bit path
- SET( ALEMBIC_ILMBASE_ROOT "C:/Program Files (x86)/ilmbase-1.0.1/" )
- ELSE()
- SET( ALEMBIC_ILMBASE_ROOT NOTFOUND )
- ENDIF()
- ENDIF()
-ELSE()
- SET( ALEMBIC_ILMBASE_ROOT ${ILMBASE_ROOT} )
-ENDIF()
-
-SET(_ilmbase_FIND_COMPONENTS
- Half
- Iex
- IexMath
- IlmThread
- Imath
-)
-
-SET(_ilmbase_SEARCH_DIRS
- ${ALEMBIC_ILMBASE_ROOT}
- ~/Library/Frameworks
- /Library/Frameworks
- /usr/local
- /usr
- /sw
- /opt/local
- /opt/csw
- /opt
- /usr/freeware
-)
-
-FIND_PATH(ILMBASE_INCLUDE_DIR
- NAMES
- IlmBaseConfig.h
- HINTS
- ${_ilmbase_SEARCH_DIRS}
- PATH_SUFFIXES
- include
- include/OpenEXR
-)
-
-# If the headers were found, get the version from config file, if not already set.
-IF(ILMBASE_INCLUDE_DIR)
- SET(ALEMBIC_ILMBASE_INCLUDE_DIRECTORY ${ILMBASE_INCLUDE_DIR})
- IF(NOT ILMBASE_VERSION)
-
- FIND_FILE(_ilmbase_CONFIG
- NAMES
- IlmBaseConfig.h
- PATHS
- "${ILMBASE_INCLUDE_DIR}"
- "${ILMBASE_INCLUDE_DIR}/OpenEXR"
- )
-
- IF(_ilmbase_CONFIG)
- FILE(STRINGS "${_ilmbase_CONFIG}" ILMBASE_BUILD_SPECIFICATION
- REGEX "^[ \t]*#define[ \t]+(ILMBASE_VERSION_STRING|VERSION)[ \t]+\"[.0-9]+\".*$")
- ELSE()
- MESSAGE(WARNING "Could not find \"OpenEXRConfig.h\" in \"${ILMBASE_INCLUDE_DIR}\"")
- ENDIF()
-
- IF(ILMBASE_BUILD_SPECIFICATION)
- STRING(REGEX REPLACE ".*#define[ \t]+(ILMBASE_VERSION_STRING|VERSION)[ \t]+\"([.0-9]+)\".*"
- "\\2" _ilmbase_libs_ver_init ${ILMBASE_BUILD_SPECIFICATION})
- ELSE()
- MESSAGE(WARNING "Could not determine ILMBase library version, assuming ${_ilmbase_libs_ver_init}.")
- ENDIF()
-
- UNSET(_ilmbase_CONFIG CACHE)
-
- ENDIF()
-
- SET("ILMBASE_VERSION" ${_ilmbase_libs_ver_init} CACHE STRING "Version of OpenEXR lib")
- UNSET(_ilmbase_libs_ver_init)
-
- STRING(REGEX REPLACE "([0-9]+)[.]([0-9]+).*" "\\1_\\2" _ilmbase_libs_ver ${ILMBASE_VERSION})
-ENDIF()
-
-
-SET(_ilmbase_LIBRARIES)
-FOREACH(COMPONENT ${_ilmbase_FIND_COMPONENTS})
- STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
-
- FIND_LIBRARY(ALEMBIC_ILMBASE_${UPPERCOMPONENT}_LIB
- NAMES
- ${COMPONENT}-${_ilmbase_libs_ver} ${COMPONENT}
- HINTS
- ${_ilmbase_SEARCH_DIRS}
- PATH_SUFFIXES
- lib64 lib
- )
- LIST(APPEND _ilmbase_LIBRARIES "${ILMBASE_${UPPERCOMPONENT}_LIBRARY}")
-ENDFOREACH()
-
-UNSET(_ilmbase_libs_ver)
-
-IF ( ${ALEMBIC_ILMBASE_HALF_LIB} STREQUAL "ALEMBIC_ILMBASE_HALF_LIB-NOTFOUND" )
- MESSAGE( FATAL_ERROR "ilmbase libraries (Half, Iex, IlmThread, Imath) not found, required" )
-ENDIF()
-
-IF ( ${ALEMBIC_ILMBASE_IEX_LIB} STREQUAL "ALEMBIC_ILMBASE_IEX_LIB-NOTFOUND" )
- MESSAGE( FATAL_ERROR "ilmbase libraries (Half, Iex, IlmThread, Imath) not found, required" )
-ENDIF()
-
-IF ( DEFINED USE_IEXMATH AND USE_IEXMATH )
- IF ( ${ALEMBIC_ILMBASE_IEXMATH_LIB} STREQUAL
- "ALEMBIC_ILMBASE_IEXMATH_LIB-NOTFOUND" )
- MESSAGE( FATAL_ERROR "ilmbase libraries (Half, Iex, IexMath, IlmThread, Imath) not found, required" )
- ENDIF()
-ENDIF()
-
-IF ( ${ALEMBIC_ILMBASE_ILMTHREAD_LIB} STREQUAL "ALEMBIC_ILMBASE_ILMTHREAD_LIB-NOTFOUND" )
- MESSAGE( FATAL_ERROR "ilmbase libraries (Half, Iex, IlmThread, Imath) not found, required" )
-ENDIF()
-
-IF ( ${ALEMBIC_ILMBASE_IMATH_LIB} STREQUAL "ALEMBIC_ILMBASE_IMATH_LIB-NOTFOUND" )
- MESSAGE( FATAL_ERROR "ilmbase libraries (Half, Iex, IlmThread, Imath) not found, required" )
-ENDIF()
-
-IF ( ${ALEMBIC_ILMBASE_INCLUDE_DIRECTORY} STREQUAL "ALEMBIC_ILMBASE_INCLUDE_DIRECTORY-NOTFOUND" )
- MESSAGE( FATAL_ERROR "ilmbase header files not found, required: ALEMBIC_ILMBASE_ROOT: ${ALEMBIC_ILMBASE_ROOT}" )
-ENDIF()
-
-
-MESSAGE( STATUS "ILMBASE INCLUDE PATH: ${ALEMBIC_ILMBASE_INCLUDE_DIRECTORY}" )
-MESSAGE( STATUS "HALF LIB: ${ALEMBIC_ILMBASE_HALF_LIB}" )
-MESSAGE( STATUS "IEX LIB: ${ALEMBIC_ILMBASE_IEX_LIB}" )
-MESSAGE( STATUS "IEXMATH LIB: ${ALEMBIC_ILMBASE_IEXMATH_LIB}" )
-MESSAGE( STATUS "ILMTHREAD LIB: ${ALEMBIC_ILMBASE_ILMTHREAD_LIB}" )
-MESSAGE( STATUS "IMATH LIB: ${ALEMBIC_ILMBASE_IMATH_LIB}" )
-
-SET( ILMBASE_FOUND TRUE )
diff --git a/cmake/Modules/FindOpenEXR.cmake b/cmake/Modules/FindOpenEXR.cmake
deleted file mode 100644
index 935fe6f..0000000
--- a/cmake/Modules/FindOpenEXR.cmake
+++ /dev/null
@@ -1,129 +0,0 @@
-##-*****************************************************************************
-##
-## Copyright (c) 2009-2011,
-## Sony Pictures Imageworks Inc. and
-## Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd.
-##
-## All rights reserved.
-##
-## Redistribution and use in source and binary forms, with or without
-## modification, are permitted provided that the following conditions are
-## met:
-## * Redistributions of source code must retain the above copyright
-## notice, this list of conditions and the following disclaimer.
-## * Redistributions in binary form must reproduce the above
-## copyright notice, this list of conditions and the following disclaimer
-## in the documentation and/or other materials provided with the
-## distribution.
-## * Neither the name of Industrial Light & Magic nor the names of
-## its contributors may be used to endorse or promote products derived
-## from this software without specific prior written permission.
-##
-## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-## OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-## DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-## THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-##
-##-*****************************************************************************
-
-
-# We shall worry about windowsification later.
-
-#-******************************************************************************
-#-******************************************************************************
-# NOW, OPENEXR STUFF. EXR IS OPTIONAL, WHERASE ILMBASE IS NOT
-#-******************************************************************************
-#-******************************************************************************
-
-IF(NOT DEFINED OPENEXR_ROOT)
- IF ( ${CMAKE_HOST_UNIX} )
- IF( ${DARWIN} )
- # TODO: set to default install path when shipping out
- SET( ALEMBIC_OPENEXR_ROOT NOTFOUND )
- ELSE()
- # TODO: set to default install path when shipping out
- SET( ALEMBIC_OPENEXR_ROOT "/usr/local/openexr-1.6.1/" )
- ENDIF()
- ELSE()
- IF ( ${WINDOWS} )
- # TODO: set to 32-bit or 64-bit path
- SET( ALEMBIC_OPENEXR_ROOT NOTFOUND )
- ELSE()
- SET( ALEMBIC_OPENEXR_ROOT NOTFOUND )
- ENDIF()
- ENDIF()
-ELSE()
- SET( ALEMBIC_OPENEXR_ROOT ${OPENEXR_ROOT} )
-ENDIF()
-
-IF(NOT $ENV{OPENEXR_ROOT}x STREQUAL "x")
- SET( ALEMBIC_OPENEXR_ROOT $ENV{OPENEXR_ROOT})
-ELSE()
- SET( ENV{OPENEXR_ROOT} ${OPENEXR_ROOT} )
-ENDIF()
-
-
-SET(LIBRARY_PATHS
- ${ALEMBIC_OPENEXR_ROOT}/lib
- ~/Library/Frameworks
- /Library/Frameworks
- /usr/local/lib
- /usr/lib
- /sw/lib
- /opt/local/lib
- /opt/csw/lib
- /opt/lib
- /usr/freeware/lib64
-)
-
-SET(INCLUDE_PATHS
- ${ALEMBIC_OPENEXR_ROOT}/include/OpenEXR/
- ~/Library/Frameworks
- /Library/Frameworks
- /usr/local/include/OpenEXR/
- /usr/local/include
- /usr/include
- /sw/include # Fink
- /opt/local/include # DarwinPorts
- /opt/csw/include # Blastwave
- /opt/include
- /usr/freeware/include
-)
-
-FIND_PATH( ALEMBIC_OPENEXR_INCLUDE_PATH ImfRgba.h
- PATHS
- ${INCLUDE_PATHS}
- DOC "The directory where ImfRgba.h resides" )
-
-FIND_LIBRARY( ALEMBIC_OPENEXR_ILMIMF_LIB IlmImf
- PATHS
- ${LIBRARY_PATHS}
- DOC "The IlmImf library" )
-
-
-SET( OPENEXR_FOUND TRUE )
-
-IF ( ${ALEMBIC_OPENEXR_INCLUDE_PATH} STREQUAL "ALEMBIC_OPENEXR_INCLUDE_PATH-NOTFOUND" )
- MESSAGE( STATUS "OpenEXR include path not found, disabling" )
- SET( OPENEXR_FOUND FALSE )
-ENDIF()
-
-IF ( ${ALEMBIC_OPENEXR_ILMIMF_LIB} STREQUAL "ALEMBIC_OPENEXR_ILMIMF_LIB-NOTFOUND" )
- MESSAGE( STATUS "OpenEXR libraries not found, disabling" )
- SET( OPENEXR_FOUND FALSE )
- SET( ALEMBIC_OPENEXR_LIBS NOTFOUND )
-ENDIF()
-
-IF (OPENEXR_FOUND)
- MESSAGE( STATUS "OPENEXR INCLUDE PATH: ${ALEMBIC_OPENEXR_INCLUDE_PATH}" )
- SET( ALEMBIC_OPENEXR_LIBS ${ALEMBIC_OPENEXR_ILMIMF_LIB} )
-ENDIF()
-
-

View File

@ -12,6 +12,7 @@ vcpkg_from_github(
HEAD_REF master
PATCHES
fix-C1083.patch
fix-find-openexr-ilmbase.patch
)
vcpkg_configure_cmake(

View File

@ -73,6 +73,11 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/doc)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/doc)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(READ ${CURRENT_PACKAGES_DIR}/share/geogram/GeogramTargets.cmake TARGET_CONFIG)
string(REPLACE [[INTERFACE_INCLUDE_DIRECTORIES "/src/lib;${_IMPORT_PREFIX}/include"]]
[[INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"]] TARGET_CONFIG "${TARGET_CONFIG}")
file(WRITE ${CURRENT_PACKAGES_DIR}/share/geogram/GeogramTargets.cmake "${TARGET_CONFIG}")
# Handle copyright
file(COPY ${SOURCE_PATH}/doc/devkit/license.dox DESTINATION ${CURRENT_PACKAGES_DIR}/share/geogram)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/geogram/license.dox ${CURRENT_PACKAGES_DIR}/share/geogram/copyright)

View File

@ -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

View File

@ -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)

View File

@ -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}")