Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support detection of single-library alembic #75

Merged
merged 1 commit into from
Nov 28, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()