@@ -45,22 +45,28 @@ if(OPENVDB_TOOL_USE_ALL)
4545endif ()
4646
4747if (OPENVDB_TOOL_USE_NANO)
48- target_compile_definitions (vdb_tool_common PUBLIC "VDB_TOOL_USE_NANO" )
48+ target_compile_definitions (vdb_tool_common INTERFACE "VDB_TOOL_USE_NANO" )
4949 if (OPENVDB_TOOL_NANO_USE_ZIP)
50- target_compile_definitions (vdb_tool_common PUBLIC "NANOVDB_USE_ZIP" )
50+ target_compile_definitions (vdb_tool_common INTERFACE "NANOVDB_USE_ZIP" )
5151 find_package (ZLIB REQUIRED)
5252 target_link_libraries (vdb_tool_common INTERFACE ZLIB::ZLIB)
5353 endif ()
5454 if (OPENVDB_TOOL_NANO_USE_BLOSC)
55- target_compile_definitions (vdb_tool_common PUBLIC "NANOVDB_USE_BLOSC" )
55+ target_compile_definitions (vdb_tool_common INTERFACE "NANOVDB_USE_BLOSC" )
5656 find_package (Blosc REQUIRED)
5757 target_link_libraries (vdb_tool_common INTERFACE blosc)
5858 endif ()
59- target_include_directories (vdb_tool_common INTERFACE ${PROJECT_SOURCE_DIR} /../nanovdb/)
59+ #target_include_directories(vdb_tool_common INTERFACE ${PROJECT_SOURCE_DIR}/../nanovdb/)
60+ if (NOT OPENVDB_BUILD_NANOVDB)
61+ message (FATAL_ERROR "Please pass -DUSE_NANOVDB=ON as a cmake argument." )
62+ else ()
63+ set (NANOVDB_LIB nanovdb)
64+ endif ()
65+ target_link_libraries (vdb_tool_common INTERFACE ${NANOVDB_LIB} )
6066endif ()
6167
6268if (OPENVDB_TOOL_USE_PNG)
63- target_compile_definitions (vdb_tool_common PUBLIC "VDB_TOOL_USE_PNG" )
69+ target_compile_definitions (vdb_tool_common INTERFACE "VDB_TOOL_USE_PNG" )
6470 if (WIN32 )
6571 find_package (libpng CONFIG REQUIRED)
6672 else ()
@@ -70,20 +76,20 @@ if(OPENVDB_TOOL_USE_PNG)
7076endif ()
7177
7278if (OPENVDB_TOOL_USE_JPG)
73- target_compile_definitions (vdb_tool_common PUBLIC "VDB_TOOL_USE_JPG" )
79+ target_compile_definitions (vdb_tool_common INTERFACE "VDB_TOOL_USE_JPG" )
7480 find_package (JPEG REQUIRED)
7581 target_link_libraries (vdb_tool_common INTERFACE ${JPEG_LIBRARIES} )
7682 target_include_directories (vdb_tool_common INTERFACE ${JPEG_INCLUDE_DIR} )
7783endif ()
7884
7985if (OPENVDB_TOOL_USE_EXR)
80- target_compile_definitions (vdb_tool_common PUBLIC "VDB_TOOL_USE_EXR" )
86+ target_compile_definitions (vdb_tool_common INTERFACE "VDB_TOOL_USE_EXR" )
8187 find_package (OpenEXR REQUIRED)
8288 target_link_libraries (vdb_tool_common INTERFACE OpenEXR::IlmImf)
8389endif ()
8490
8591if (OPENVDB_TOOL_USE_ABC)
86- target_compile_definitions (vdb_tool_common PUBLIC "VDB_TOOL_USE_ABC" )
92+ target_compile_definitions (vdb_tool_common INTERFACE "VDB_TOOL_USE_ABC" )
8793 find_package (Alembic CONFIG REQUIRED)
8894 target_link_libraries (vdb_tool_common INTERFACE Alembic::Alembic)
8995endif ()
0 commit comments