Skip to content

Commit 80198df

Browse files
committed
Add support to link against a preinstalled nanovdb.
Signed-off-by: Andre Pradhana <[email protected]>
1 parent 1dda673 commit 80198df

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

openvdb_cmd/vdb_tool/CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,15 @@ if(OPENVDB_TOOL_USE_NANO)
5858
endif()
5959
#target_include_directories(vdb_tool_common INTERFACE ${PROJECT_SOURCE_DIR}/../nanovdb/)
6060
if(NOT OPENVDB_BUILD_NANOVDB)
61-
message(FATAL_ERROR "Please pass -DUSE_NANOVDB=ON as a cmake argument.")
61+
find_package(OpenVDB COMPONENTS nanovdb)
62+
if(NOT OpenVDB_nanovdb_FOUND OR NOT OpenVDB_FOUND)
63+
message(FATAL_ERROR
64+
" Couldn't find NanoVDB\n"
65+
" Either set OPENVDB_CMAKE_PATH to <OpenVDB install path>/lib/cmake/OpenVDB"
66+
" or please pass -DUSE_NANOVDB=ON as a cmake argument.")
67+
endif()
68+
set(NANOVDB_LIB OpenVDB::nanovdb)
69+
target_include_directories(vdb_tool_common INTERFACE ${OPENVDB_nanovdb_INCLUDE_DIR})
6270
else()
6371
set(NANOVDB_LIB nanovdb)
6472
endif()

0 commit comments

Comments
 (0)