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

Add options to enable or disable installation of mujoco samples and simulate #1478

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
40 changes: 22 additions & 18 deletions sample/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,24 +118,28 @@ if(APPLE AND MUJOCO_BUILD_MACOS_FRAMEWORKS)
set(_INSTALL_SAMPLES OFF)
endif()

if(_INSTALL_SAMPLES)

include(TargetAddRpath)

# Add support to RPATH for the samples.
target_add_rpath(
TARGETS
basic
compile
record
testspeed
INSTALL_DIRECTORY
"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}"
LIB_DIRS
"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}"
DEPENDS
MUJOCO_ENABLE_RPATH
)
option(MUJOCO_SAMPLES_INSTALL "If ON, also install samples executables." ${_INSTALL_SAMPLES})

if(MUJOCO_SAMPLES_INSTALL)

if(MUJOCO_ENABLE_RPATH)
include(TargetAddRpath)

# Add support to RPATH for the samples.
target_add_rpath(
TARGETS
basic
compile
record
testspeed
INSTALL_DIRECTORY
"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}"
LIB_DIRS
"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}"
DEPENDS
MUJOCO_ENABLE_RPATH
)
endif()

install(
TARGETS basic
Expand Down
30 changes: 17 additions & 13 deletions simulate/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -223,21 +223,25 @@ if(SIMULATE_BUILD_EXECUTABLE)
set(_INSTALL_SIMULATE OFF)
endif()

if(_INSTALL_SIMULATE)
option(MUJOCO_SIMULATE_INSTALL "If ON, also install simulate executable." ${_INSTALL_SIMULATE})

include(TargetAddRpath)
if(MUJOCO_SIMULATE_INSTALL)

# Add support to RPATH for the samples.
target_add_rpath(
TARGETS
simulate
INSTALL_DIRECTORY
"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}"
LIB_DIRS
"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}"
DEPENDS
MUJOCO_ENABLE_RPATH
)
if(MUJOCO_ENABLE_RPATH)
include(TargetAddRpath)

# Add support to RPATH for the samples.
target_add_rpath(
TARGETS
simulate
INSTALL_DIRECTORY
"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}"
LIB_DIRS
"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}"
DEPENDS
MUJOCO_ENABLE_RPATH
)
endif()

install(
TARGETS simulate
Expand Down
Loading