Skip to content

Commit

Permalink
Merge pull request alembic#355 from lgritz/lg-exr2
Browse files Browse the repository at this point in the history
Fixes to make Alembic exported config work for OpenEXR 2.x or Imath 3.x
  • Loading branch information
lamiller0 committed Jul 21, 2021
2 parents b82b487 + c5854c1 commit 6bd2242
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cmake/AlembicIlmBase.cmake
Expand Up @@ -39,10 +39,12 @@ FIND_PACKAGE(Imath)
IF (Imath_FOUND)
MESSAGE(STATUS "Found package Imath")
SET(ALEMBIC_ILMBASE_LIBS Imath::Imath)
SET(ALEMBIC_USING_IMATH_3 ON)
ELSE()
MESSAGE(STATUS "Could not find Imath looking for IlmBase instead.")
# What we really want to do is look for libs Imath and half
FIND_PACKAGE(IlmBase)
SET(ALEMBIC_USING_IMATH_3 OFF)

IF (ILMBASE_FOUND)
SET(ALEMBIC_ILMBASE_FOUND 1 CACHE STRING "Set to 1 if IlmBase is found, 0 otherwise")
Expand Down
7 changes: 6 additions & 1 deletion lib/Alembic/AlembicConfig.cmake.in
Expand Up @@ -2,7 +2,12 @@

include(CMakeFindDependencyMacro)
# TODO whenever we loose the back-compatibility with IlmBase < 3, a REQUIRED needs to be added to find_dependency()
find_dependency(Imath)
if (@ALEMBIC_USING_IMATH_3@)
find_dependency(Imath)
else ()
# Compatibility with OpenEXR 2.x, prior to Imath 3.x
find_dependency(IlmBase)
endif ()

SET(Alembic_HAS_HDF5 @USE_HDF5@)
SET(Alembic_HAS_SHARED_LIBS @ALEMBIC_SHARED_LIBS@)
Expand Down

0 comments on commit 6bd2242

Please sign in to comment.