[Bf-blender-cvs] [d739889] alembic: Alembic: Make alembic's HDF5 library optional

Sergey Sharybin noreply at git.blender.org
Tue Apr 21 10:41:35 CEST 2015


Commit: d739889cb9d6266e40d3dee9366f9c26731acfb2
Author: Sergey Sharybin
Date:   Tue Apr 21 13:39:52 2015 +0500
Branches: alembic
https://developer.blender.org/rBd739889cb9d6266e40d3dee9366f9c26731acfb2

Alembic: Make alembic's HDF5 library optional

This way blender will be happy about alembic compiled without HDF5 support.

===================================================================

M	CMakeLists.txt
M	build_files/cmake/Modules/FindAlembic.cmake

===================================================================

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9d6cfd2..5984e04 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 8327101..1fd9640 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)




More information about the Bf-blender-cvs mailing list