CMake: fix hdEmbree.dll deployment path -- copy to usd/ not exe root

plugInfo.json declares LibraryPath '../hdEmbree.dll', relative to usd/hdEmbree/,
so the DLL must live at usd/hdEmbree.dll. The previous POST_BUILD copied it to
the exe root, causing the module-not-found error at load time.

Fix: copy hdEmbree.dll into usd/ for POST_BUILD and install(). embree3.dll
stays in the exe root where Windows DLL search finds it as a dependency.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-18 22:45:50 +08:00
parent 11ce024d6c
commit 364973fb65
+5 -2
View File
@@ -112,9 +112,11 @@ if(WIN32)
if(OPENUSD_HAS_EMBREE)
add_custom_command(TARGET UsdLayerManager POST_BUILD
# plugInfo.json has LibraryPath "../hdEmbree.dll" relative to usd/hdEmbree/,
# which resolves to usd/hdEmbree.dll — so the DLL must live in usd/, not exe root.
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${HDEMBREE_DLL}"
"$<TARGET_FILE_DIR:UsdLayerManager>"
"$<TARGET_FILE_DIR:UsdLayerManager>/usd/hdEmbree.dll"
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${HDEMBREE_PLUGIN_DIR}"
"$<TARGET_FILE_DIR:UsdLayerManager>/usd/hdEmbree"
@@ -170,8 +172,9 @@ install(FILES ${OpenUSD_ROOT_DIR}/plugin/usd/hdStorm.dll
)
if(OPENUSD_HAS_EMBREE)
# Install to bin/usd/ so plugInfo.json's LibraryPath "../hdEmbree.dll" resolves correctly.
install(FILES "${HDEMBREE_DLL}"
DESTINATION bin
DESTINATION bin/usd
OPTIONAL
)
install(DIRECTORY "${HDEMBREE_PLUGIN_DIR}"