Skip to content

Commit

Permalink
Allow external openvdb
Browse files Browse the repository at this point in the history
  • Loading branch information
bartus committed Feb 22, 2022
1 parent 7ce2139 commit 58eeee7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
10 changes: 10 additions & 0 deletions cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,13 @@ ENDIF (NOT BISON_NOT_AVAILABLE)
IF (NOT FLEX_NOT_AVAILABLE)
find_package(FLEX)
ENDIF (NOT FLEX_NOT_AVAILABLE)

# Find OpenVDB
if(NOT USE_BUNDLE_OPENVDB)
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE)
# preserve Boost_LIBRARIES
set(save_Boost_LIBRARIES ${Boost_LIBRARIES})
find_package(OpenVDB REQUIRED)
set(Boost_LIBRARIES ${save_Boost_LIBRARIES})
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG FALSE)
endif()
1 change: 0 additions & 1 deletion src/luxcore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ set(PYLUXCORE_SRCS

add_library(pyluxcore MODULE ${PYLUXCORE_SRCS} ${LUXCORE_LIB_SRCS} ${LUX_PARSER_SRC})

include_directories(${LuxRays_SOURCE_DIR}/deps/openvdb-7.0.0)
include_directories(${LuxRays_SOURCE_DIR}/deps/opencolorio-2.0.0/include)

add_definitions(-DOPENVDB_STATICLIB ${VISIBILITY_FLAGS})
Expand Down
13 changes: 10 additions & 3 deletions src/slg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,19 @@ set(OPENVDB_SRCS

SOURCE_GROUP("Source Files\\OpenVDB Library" FILES ${OPENVDB_SRCS})

include_directories(${LuxRays_SOURCE_DIR}/deps/openvdb-7.0.0)

# Required by OpenVDB to read ABI 3
#add_definitions("-D OPENVDB_USE_DEPRECATED_ABI -DOPENVDB_3_ABI_COMPATIBLE -DOPENVDB_STATICLIB -DOPENVDB_OPENEXR_STATICLIB")
add_definitions("-DOPENVDB_USE_BLOSC -DOPENVDB_STATICLIB -DOPENVDB_OPENEXR_STATICLIB")
add_library(openvdb STATIC ${OPENVDB_SRCS})
if(USE_BUNDLE_OPENVDB)
add_library(openvdb STATIC ${OPENVDB_SRCS})
set_target_properties(openvdb INCLUDE_DIRECTORIES ${LuxRays_SOURCE_DIR}/deps/openvdb-7.0.0)
else()
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE)
find_package(OpenVDB REQUIRED)
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG FALSE)
add_library(openvdb INTERFACE)
target_link_libraries(openvdb INTERFACE OpenVDB::openvdb)
endif()

###########################################################################
#
Expand Down

0 comments on commit 58eeee7

Please sign in to comment.