Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.

Commit 17c52b6

Browse files
Apply suggestions from code review for CMakeLists.txt
Co-authored-by: Erik Holum <[email protected]>
1 parent a8d7a8a commit 17c52b6

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

CMakeLists.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ find_package(rclcpp REQUIRED)
1717
find_package(rclcpp_lifecycle REQUIRED)
1818
find_package(Threads REQUIRED)
1919

20-
# Import MuJoCo via vendor package (already installed)
21-
find_package(mujoco_vendor REQUIRED)
20+
# Attempt to link MuJoCo via the vendor package, if available
21+
find_package(mujoco_vendor QUIET)
2222
if(mujoco_vendor_FOUND)
2323
set(MUJOCO_LIB mujoco::mujoco)
2424
set(MUJOCO_INCLUDE_DIR ${mujoco_vendor_INCLUDE_DIRS})
2525
set(MUJOCO_SIMULATE_DIR ${MUJOCO_INCLUDE_DIR}/../simulate)
26-
26+
# If the user has specified a MuJoCo install location use it
2727
elseif(DEFINED ENV{MUJOCO_INSTALL_DIR})
2828
message(STATUS "Mujoco build from source has not been found. Attempting to find the binary in $ENV{MUJOCO_INSTALL_DIR} instead.")
2929
set(MUJOCO_DIR $ENV{MUJOCO_INSTALL_DIR})
@@ -33,9 +33,10 @@ elseif(DEFINED ENV{MUJOCO_INSTALL_DIR})
3333
endif()
3434
set(MUJOCO_INCLUDE_DIR $ENV{MUJOCO_DIR}/include)
3535
set(MUJOCO_SIMULATE_DIR $ENV{MUJOCO_DIR}/simulate)
36+
# Otherwise we fallback and download the required tarfile and install it manually
3637
else()
3738
include(FetchContent)
38-
# Detect architecture
39+
# Detect architecture
3940
set(MUJOCO_VERSION "3.3.4")
4041
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64")
4142
set(CPU_ARCH "x86_64")

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This interface has only been tested against ROS 2 jazzy and MuJoCo `3.3.4`.
1414
It should also be compatible with kilted and rolling, but we do not actively maintain those.
1515
We assume all required ROS dependencies have been installed either manually or with `rosdep`.
1616

17-
For configuring MuJoCo, the included [CMakeLists.txt](./CMakeLists.txt) will first attempt to use the [mujoco_vendor](https://github.com/pal-robotics/mujoco_vendor) package if it is installed in your workspace.
17+
For configuring MuJoCo, the included [CMakeLists.txt](./CMakeLists.txt) will first attempt to use the [mujoco_vendor](https://github.com/pal-robotics/mujoco_vendor) package if it is installed in your workspace.
1818
If it is not found, a local install of MuJoCo can be used to build the application by setting the following environment variables,
1919

2020
```bash

0 commit comments

Comments
 (0)