OpenVDB.cmake 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. if(BUILD_SHARED_LIBS)
  2. set(_build_shared ON)
  3. set(_build_static OFF)
  4. else()
  5. set(_build_shared OFF)
  6. set(_build_static ON)
  7. endif()
  8. set (_openvdb_vdbprint ON)
  9. if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
  10. # Build fails on raspberry pi due to missing link directive to latomic
  11. # Let's hope it will be fixed soon.
  12. set (_openvdb_vdbprint OFF)
  13. endif ()
  14. prusaslicer_add_cmake_project(OpenVDB
  15. # 8.2 patched
  16. URL https://github.com/tamasmeszaros/openvdb/archive/a68fd58d0e2b85f01adeb8b13d7555183ab10aa5.zip
  17. URL_HASH SHA256=f353e7b99bd0cbfc27ac9082de51acf32a8bc0b3e21ff9661ecca6f205ec1d81
  18. DEPENDS dep_TBB dep_Blosc dep_OpenEXR dep_Boost
  19. CMAKE_ARGS
  20. -DCMAKE_POSITION_INDEPENDENT_CODE=ON
  21. -DOPENVDB_BUILD_PYTHON_MODULE=OFF
  22. -DUSE_BLOSC=ON
  23. -DOPENVDB_CORE_SHARED=${_build_shared}
  24. -DOPENVDB_CORE_STATIC=${_build_static}
  25. -DOPENVDB_ENABLE_RPATH:BOOL=OFF
  26. -DTBB_STATIC=${_build_static}
  27. -DOPENVDB_BUILD_VDB_PRINT=${_openvdb_vdbprint}
  28. -DDISABLE_DEPENDENCY_VERSION_CHECKS=ON # Centos6 has old zlib
  29. )
  30. if (MSVC)
  31. if (${DEP_DEBUG})
  32. ExternalProject_Get_Property(dep_OpenVDB BINARY_DIR)
  33. ExternalProject_Add_Step(dep_OpenVDB build_debug
  34. DEPENDEES build
  35. DEPENDERS install
  36. COMMAND ${CMAKE_COMMAND} ../dep_OpenVDB -DOPENVDB_BUILD_VDB_PRINT=OFF
  37. COMMAND msbuild /m /P:Configuration=Debug INSTALL.vcxproj
  38. WORKING_DIRECTORY "${BINARY_DIR}"
  39. )
  40. endif ()
  41. endif ()