File tree Expand file tree Collapse file tree 3 files changed +20
-4
lines changed Expand file tree Collapse file tree 3 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -160,3 +160,13 @@ ENDIF (NOT BISON_NOT_AVAILABLE)
160160IF (NOT FLEX_NOT_AVAILABLE)
161161 find_package (FLEX)
162162ENDIF (NOT FLEX_NOT_AVAILABLE)
163+
164+ # Find OpenVDB
165+ if (NOT USE_BUNDLE_OPENVDB)
166+ set (CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE )
167+ # preserve Boost_LIBRARIES
168+ set (save_Boost_LIBRARIES ${Boost_LIBRARIES} )
169+ find_package (OpenVDB REQUIRED)
170+ set (Boost_LIBRARIES ${save_Boost_LIBRARIES} )
171+ set (CMAKE_FIND_PACKAGE_PREFER_CONFIG FALSE )
172+ endif ()
Original file line number Diff line number Diff line change @@ -175,7 +175,6 @@ set(PYLUXCORE_SRCS
175175
176176add_library (pyluxcore MODULE ${PYLUXCORE_SRCS} ${LUXCORE_LIB_SRCS} ${LUX_PARSER_SRC} )
177177
178- include_directories (${LuxRays_SOURCE_DIR} /deps/openvdb-7.0.0)
179178include_directories (${LuxRays_SOURCE_DIR} /deps/opencolorio-2.0.0/include )
180179
181180add_definitions (-DOPENVDB_STATICLIB ${VISIBILITY_FLAGS} )
Original file line number Diff line number Diff line change @@ -143,12 +143,19 @@ set(OPENVDB_SRCS
143143
144144SOURCE_GROUP ("Source Files\\ OpenVDB Library" FILES ${OPENVDB_SRCS} )
145145
146- include_directories (${LuxRays_SOURCE_DIR} /deps/openvdb-7.0.0)
147-
148146# Required by OpenVDB to read ABI 3
149147#add_definitions("-D OPENVDB_USE_DEPRECATED_ABI -DOPENVDB_3_ABI_COMPATIBLE -DOPENVDB_STATICLIB -DOPENVDB_OPENEXR_STATICLIB")
150148add_definitions ("-DOPENVDB_USE_BLOSC -DOPENVDB_STATICLIB -DOPENVDB_OPENEXR_STATICLIB" )
151- add_library (openvdb STATIC ${OPENVDB_SRCS} )
149+ if (USE_BUNDLE_OPENVDB)
150+ add_library (openvdb STATIC ${OPENVDB_SRCS} )
151+ set_target_properties (openvdb INCLUDE_DIRECTORIES ${LuxRays_SOURCE_DIR} /deps/openvdb-7.0.0)
152+ else ()
153+ set (CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE )
154+ find_package (OpenVDB REQUIRED)
155+ set (CMAKE_FIND_PACKAGE_PREFER_CONFIG FALSE )
156+ add_library (openvdb INTERFACE )
157+ target_link_libraries (openvdb INTERFACE OpenVDB::openvdb)
158+ endif ()
152159
153160###########################################################################
154161#
You can’t perform that action at this time.
0 commit comments