Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow MUJOCO_DIR to be specified as cmake variable #41

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions mujoco_ros/cmake/Findmujoco.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,19 @@ endif()

if(NOT mujoco_FOUND)
message(STATUS "Looking for MuJoCo tar install ...")
# Initialize MUJOCO_DIR from environment variable if not yet set as cmake variable
if(NOT DEFINED MUJOCO_DIR)
set(MUJOCO_DIR $ENV{MUJOCO_DIR} CACHE PATH "Path to MuJoCo installation directory")
endif()
# Find headers
find_file(mujoco_INCLUDE_DIRS include/mujoco/mujoco.h PATHS ENV MUJOCO_DIR)
find_file(mujoco_INCLUDE_DIRS include/mujoco/mujoco.h PATHS ${MUJOCO_DIR})
if(mujoco_INCLUDE_DIRS)
get_filename_component(mujoco_INCLUDE_DIRS ${mujoco_INCLUDE_DIRS} PATH)
get_filename_component(mujoco_INCLUDE_DIRS ${mujoco_INCLUDE_DIRS} PATH)
endif()

# Find library
find_library(mujoco_LIBRARIES lib/libmujoco.so PATHS ENV MUJOCO_DIR)
find_library(mujoco_LIBRARIES lib/libmujoco.so PATHS ${MUJOCO_DIR})

# Find dependencies
cmake_policy(SET CMP0072 NEW)
Expand Down
Loading