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:
committed by
Copybara-Service
parent
76e0a78b32
commit
9e150fe82c
@@ -0,0 +1,38 @@
|
||||
# Copyright 2025 DeepMind Technologies Limited
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Find OpenUSD package. The user can either provide pxr_DIR to use their own
|
||||
# OpenUSD installation or they can build external_dependencies.
|
||||
#
|
||||
# We use QUIET here to provide a better error message when pxr is not found.
|
||||
find_package(pxr
|
||||
QUIET
|
||||
HINTS "${CMAKE_BINARY_DIR}/_deps/openusd-build"
|
||||
)
|
||||
|
||||
if(NOT pxr_FOUND)
|
||||
message(FATAL_ERROR
|
||||
"-----------------------------------------------------------\n"
|
||||
"USD Configuration Error:\n${pxr_NOT_FOUND_MESSAGE}\n"
|
||||
"If you have built USD yourself, provide -Dpxr_DIR=your_pxr_install_dir' \n"
|
||||
"Otherwise you can build cmake/third_party_deps/openusd:\n"
|
||||
"cd ~/mujoco\n"
|
||||
"cmake -Bcmake/third_party_deps/openusd/build cmake/third_party_deps/openusd -DBUILD_USD=True\n"
|
||||
"cmake --build cmake/third_party_deps/openusd/build\n"
|
||||
"cmake -Bbuild -S. -DMUJOCO_WITH_USD=True\n"
|
||||
"cmake --build build\n"
|
||||
"cmake --install build"
|
||||
"-----------------------------------------------------------"
|
||||
)
|
||||
endif()
|
||||
Reference in New Issue
Block a user