Add separate build step for OpenUSD to third_party_deps.

This will fetch and call the build_usd.py build helper for OpenUSD and build within the MuJoCo _deps folder. Simplifying the build process for MuJoCo with USD. Users can still provide their own USD build, but must now do so via pxr_DIR.

PiperOrigin-RevId: 846735578
Change-Id: I0da7eb2da6465e2d518084340e762bf370adb6d5
This commit is contained in:
Sam Haves
2025-12-19 07:59:17 -08:00
committed by Copybara-Service
parent 76e0a78b32
commit 9e150fe82c
6 changed files with 178 additions and 109 deletions
+12 -4
View File
@@ -185,7 +185,7 @@ if(SIMULATE_BUILD_EXECUTABLE)
target_link_libraries(simulate "-framework CoreVideo")
endif()
if (MUJOCO_WITH_USD)
if (BUILD_WITH_USD)
# pxr/usd/tf/hashset.h might include deprecated headers so disable this check
# when compiling with USD enabled.
target_compile_options(
@@ -265,8 +265,13 @@ if(SIMULATE_BUILD_EXECUTABLE)
MUJOCO_ENABLE_RPATH
)
if (MUJOCO_WITH_USD)
target_compile_definitions(simulate PUBLIC mjUSEUSD)
if (BUILD_WITH_USD)
# pxr/usd/tf/hashset.h might include deprecated headers so disable this check
# when compiling with USD enabled.
target_compile_options(
simulate
PRIVATE -Wno-deprecated
)
# Add support to RPATH for the samples.
target_add_rpath(
@@ -275,10 +280,13 @@ if(SIMULATE_BUILD_EXECUTABLE)
INSTALL_DIRECTORY
"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}"
LIB_DIRS
${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/mujocoUsd ${USD_DIR}/lib
DEPENDS
MUJOCO_ENABLE_RPATH
)
# Do we need this?
#target_link_options(simulate PRIVATE -rpath=${pxr_DIR}/lib)
endif()
if(NOT MUJOCO_SIMULATE_USE_SYSTEM_GLFW)