-
Notifications
You must be signed in to change notification settings - Fork 0
/
mujoco.cmake
45 lines (39 loc) · 1.39 KB
/
mujoco.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
if (TARGET mujoco::mujoco)
else()
include(FetchContent)
FetchContent_Declare(
mujoco
GIT_REPOSITORY https://github.com/deepmind/mujoco.git
GIT_TAG 2.3.2 #main
)
FetchContent_GetProperties(mujoco)
if(NOT mujoco_POPULATED)
FetchContent_Populate(mujoco)
set(MUJOCO_BUILD_EXAMPLES OFF)
set(MUJOCO_BUILD_TESTS OFF)
set(MUJOCO_TEST_PYTHON_UTIL OFF)
# set(MUJOCO_BUILD_SIMULATE OFF)
# Prevent targets from being added to the ALL build. As a result only dependencies referenced
# in other targets will be built. INSTALL target will not be built for example.
add_subdirectory(${mujoco_SOURCE_DIR} ${mujoco_BINARY_DIR} ) # EXCLUDE_FROM_ALL)
endif()
set_target_properties( simulate
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin"
OUTPUT_NAME "simulation"
)
if (UNIX)
set_target_properties( mujoco
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib"
)
else (WINDOWS)
set_target_properties( mujoco
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin"
)
endif()
endif()