Skip to content

Commit cb44e6c

Browse files
KamalTDclaude
andcommitted
cmake: fix Windows Houdini build — auto-detect openvdb_sesi and set search paths
On Windows, Houdini ships its OpenVDB library as openvdb_sesi.lib/dll rather than openvdb.lib/dll (the name used on Linux/macOS). FindOpenVDB searches only for the component name verbatim, so Windows Houdini builds have always required the manual cmake flag: -DOpenVDB_openvdb_LIBRARY=<HFS>/custom/houdini/dsolib/openvdb_sesi.lib Fix this by adding an OpenVDB section to OpenVDBHoudiniSetup.cmake that: - Sets OPENVDB_LIBRARYDIR/OPENVDB_INCLUDEDIR to Houdini's toolkit paths so FindOpenVDB knows where to look without extra hints. - On Windows, pre-sets OpenVDB_openvdb_LIBRARY by searching for both openvdb_sesi and openvdb names in Houdini's dsolib directory, eliminating the need for a manual command-line override. Tested with Houdini 20.5.613 (OpenVDB 11.0.0, ABI 11) on Windows 11. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: KAMAL <m.kamalvfx@gmail.com>
1 parent f975414 commit cb44e6c

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

cmake/OpenVDBHoudiniSetup.cmake

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,27 @@ elseif(WIN32)
317317
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES "_sidefx.lib")
318318
endif()
319319

320+
# OpenVDB - point FindOpenVDB at Houdini's installation
321+
322+
if(NOT OPENVDB_LIBRARYDIR)
323+
set(OPENVDB_LIBRARYDIR ${HOUDINI_LIB_DIR})
324+
endif()
325+
if(NOT OPENVDB_INCLUDEDIR)
326+
set(OPENVDB_INCLUDEDIR ${HOUDINI_INCLUDE_DIR})
327+
endif()
328+
329+
# On Windows, Houdini ships its OpenVDB library as openvdb_sesi.lib/dll
330+
# rather than openvdb.lib/dll. FindOpenVDB only searches for the component
331+
# name verbatim, so pre-set the cache variable here so it resolves correctly
332+
# without requiring -DOpenVDB_openvdb_LIBRARY on the command line.
333+
if(WIN32 AND NOT OpenVDB_openvdb_LIBRARY)
334+
find_library(OpenVDB_openvdb_LIBRARY
335+
NAMES openvdb_sesi openvdb
336+
PATHS ${HOUDINI_LIB_DIR}
337+
NO_DEFAULT_PATH
338+
)
339+
endif()
340+
320341
# ------------------------------------------------------------------------
321342
# Configure OpenVDB ABI
322343
# ------------------------------------------------------------------------

0 commit comments

Comments
 (0)