Skip to content

Commit

Permalink
Merge pull request #75 from asluk/dev_abc_1_6_support
Browse files Browse the repository at this point in the history
Support detection of single-library alembic
  • Loading branch information
pixar-oss committed Nov 28, 2016
2 parents e333e7e + 7790a5f commit 8bc0f73
Showing 1 changed file with 55 additions and 37 deletions.
92 changes: 55 additions & 37 deletions cmake/modules/FindAlembic.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,53 +54,71 @@ set(LIBRARY_PATHS

# Find Alembic libs

find_library(ALEMBIC_ABC_LIBRARY
NAMES AlembicAbc
# First look for single Alembic library,
# as shipped in versions >= 1.6.0
find_library(ALEMBIC_LIBRARY
NAMES Alembic
PATHS ${LIBRARY_PATHS}
)

find_library(ALEMBIC_ABCGEOM_LIBRARY
NAMES AlembicAbcGeom
PATHS ${LIBRARY_PATHS}
)
# If single library is not found, look for legacy Alembic libraries.
if(NOT ALEMBIC_LIBRARY)
message(STATUS "Single Alembic library not found; looking for legacy libs")

find_library(ALEMBIC_ABCCOREHDF5_LIBRARY
NAMES AlembicAbcCoreHDF5
PATHS ${LIBRARY_PATHS}
)
find_library(ALEMBIC_ABC_LIBRARY
NAMES AlembicAbc
PATHS ${LIBRARY_PATHS}
)

find_library(ALEMBIC_ABCCOREOGAWA_LIBRARY
NAMES AlembicAbcCoreOgawa
PATHS ${LIBRARY_PATHS}
)
find_library(ALEMBIC_ABCGEOM_LIBRARY
NAMES AlembicAbcGeom
PATHS ${LIBRARY_PATHS}
)

find_library(ALEMBIC_ABCCOREABSTRACT_LIBRARY
NAMES AlembicAbcCoreAbstract
PATHS ${LIBRARY_PATHS}
)
find_library(ALEMBIC_ABCCOREHDF5_LIBRARY
NAMES AlembicAbcCoreHDF5
PATHS ${LIBRARY_PATHS}
)

find_library(ALEMBIC_UTIL_LIBRARY
NAMES AlembicUtil
PATHS ${LIBRARY_PATHS}
)
find_library(ALEMBIC_ABCCOREOGAWA_LIBRARY
NAMES AlembicAbcCoreOgawa
PATHS ${LIBRARY_PATHS}
)

find_library(ALEMBIC_OGAWA_LIBRARY
NAMES AlembicOgawa
PATHS ${LIBRARY_PATHS}
)
find_library(ALEMBIC_ABCCOREABSTRACT_LIBRARY
NAMES AlembicAbcCoreAbstract
PATHS ${LIBRARY_PATHS}
)

find_library(ALEMBIC_UTIL_LIBRARY
NAMES AlembicUtil
PATHS ${LIBRARY_PATHS}
)

set (ALEMBIC_LIBRARIES
${ALEMBIC_ABCGEOM_LIBRARY}
${ALEMBIC_ABC_LIBRARY}
${ALEMBIC_ABCCOREHDF5_LIBRARY}
${ALEMBIC_ABCCOREOGAWA_LIBRARY}
${ALEMBIC_ABCCOREABSTRACT_LIBRARY}
${ALEMBIC_UTIL_LIBRARY}
${ALEMBIC_OGAWA_LIBRARY}
)
find_library(ALEMBIC_OGAWA_LIBRARY
NAMES AlembicOgawa
PATHS ${LIBRARY_PATHS}
)

set (ALEMBIC_LIBRARIES
${ALEMBIC_ABCGEOM_LIBRARY}
${ALEMBIC_ABC_LIBRARY}
${ALEMBIC_ABCCOREHDF5_LIBRARY}
${ALEMBIC_ABCCOREOGAWA_LIBRARY}
${ALEMBIC_ABCCOREABSTRACT_LIBRARY}
${ALEMBIC_UTIL_LIBRARY}
${ALEMBIC_OGAWA_LIBRARY}
)

get_filename_component(ALEMBIC_LIBRARY_DIR ${ALEMBIC_ABC_LIBRARY} PATH)
else()
set (ALEMBIC_LIBRARIES
${ALEMBIC_LIBRARY}
)

get_filename_component(ALEMBIC_LIBRARY_DIR ${ALEMBIC_LIBRARY} PATH)
endif()

get_filename_component(ALEMBIC_LIBRARY_DIR ${ALEMBIC_ABC_LIBRARY} PATH)

# Find Alembic include dir
find_path (ALEMBIC_INCLUDE_DIR Alembic/Abc/All.h
Expand All @@ -117,4 +135,4 @@ find_package_handle_standard_args( "Alembic"
)
if(NOT ALEMBIC_FOUND)
message(WARNING "Try using -D ALEMBIC_DIR=/path/to/alembic")
endif()
endif()

0 comments on commit 8bc0f73

Please sign in to comment.