diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-04-21 11:39:52 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-04-21 11:39:52 +0300 |
commit | d739889cb9d6266e40d3dee9366f9c26731acfb2 (patch) | |
tree | 82baf68b76311384e2b9a8f86a61f3135de5ed22 | |
parent | 944ac62ad16266cce859b65c5323418e0c852599 (diff) |
Alembic: Make alembic's HDF5 library optional
This way blender will be happy about alembic compiled without HDF5 support.
-rw-r--r-- | CMakeLists.txt | 4 | ||||
-rw-r--r-- | build_files/cmake/Modules/FindAlembic.cmake | 21 |
2 files changed, 24 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d6cfd296ff..5984e04eefb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1143,6 +1143,10 @@ if(UNIX AND NOT APPLE) if(WITH_ALEMBIC) find_package_wrapper(Alembic) set(ALEMBIC_LIBRARIES ${ALEMBIC_LIBRARIES} ${BOOST_LIBRARIES}) + if(NOT ALEMBIC_HDF5_FOUND) + message(STATUS "Alembic is compiled without HDF5 support, disabling HDF5 options") + set(WITH_HDF5 OFF) + endif() endif() if(WITH_HDF5) diff --git a/build_files/cmake/Modules/FindAlembic.cmake b/build_files/cmake/Modules/FindAlembic.cmake index 8327101c821..1fd964026d2 100644 --- a/build_files/cmake/Modules/FindAlembic.cmake +++ b/build_files/cmake/Modules/FindAlembic.cmake @@ -6,6 +6,7 @@ # ALEMBIC_ROOT_DIR, The base directory to search for Alembic. # This can also be an environment variable. # ALEMBIC_FOUND, If false, do not try to use Alembic. +# ALEMBIC_HDF5_FOUND, indicates whether Alembic supports HDF5 #============================================================================= # Copyright 2013 Blender Foundation. @@ -36,7 +37,6 @@ SET(_alembic_FIND_COMPONENTS AlembicAbc AlembicAbcCoreAbstract AlembicAbcGeom - AlembicAbcCoreHDF5 AlembicAbcCoreOgawa AlembicOgawa AlembicUtil @@ -61,12 +61,31 @@ FOREACH(COMPONENT ${_alembic_FIND_COMPONENTS}) HINTS ${_alembic_SEARCH_DIRS} PATH_SUFFIXES + lib lib/static ) MARK_AS_ADVANCED(ALEMBIC_${UPPERCOMPONENT}_LIBRARY) LIST(APPEND _alembic_LIBRARIES "${ALEMBIC_${UPPERCOMPONENT}_LIBRARY}") ENDFOREACH() +# Sepcial handling of optional libraries +FIND_LIBRARY(ALEMBIC_ALEMBICABCCOREHDF5_LIBRARY + NAMES + AlembicAbcCoreHDF5 + HINTS + ${_alembic_SEARCH_DIRS} + PATH_SUFFIXES + lib + lib/static + ) +MARK_AS_ADVANCED(ALEMBIC_ALEMBICABCCOREHDF5_LIBRARY) +IF(ALEMBIC_ALEMBICABCCOREHDF5_LIBRARY) + LIST(APPEND _alembic_LIBRARIES "${ALEMBIC_ALEMBICABCCOREHDF5_LIBRARY}") + SET(ALEMBIC_HDF5_FOUND TRUE) +ELSE() + SET(ALEMBIC_HDF5_FOUND FALSE) +ENDIF() + # handle the QUIETLY and REQUIRED arguments and set ALEMBIC_FOUND to TRUE if # all listed variables are TRUE INCLUDE(FindPackageHandleStandardArgs) |