-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
37 lines (28 loc) · 2.21 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.5)
project(mujoco_ros2)
# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()
# Find dependencies
find_package(ament_cmake REQUIRED) # So ROS2 can compile?
find_package(glfw3 REQUIRED) # Graphics Library FrameWork
find_package(rclcpp REQUIRED) # ROS2 C++ libraries
find_package(sensor_msgs REQUIRED) # sensor_msgs::msg::JointState
find_package(std_msgs REQUIRED) # std_msgs::msg::Float64MultiArray
# MuJoCo
set(MUJOCO_PATH "/opt/mujoco/mujoco-3.2.0") # UPDATE THIS TO YOUR MUJOCO PATH
include_directories(include) # Local header files
include_directories(${MUJOCO_PATH}/include/mujoco) # MuJoCo header files
include_directories(${MUJOCO_PATH}/include) # Additional MuJoCo header files
link_directories(${MUJOCO_PATH}/lib) # Location of MuJoCo libraries
add_executable(mujoco_node src/executable.cpp src/MuJoCoNode.cpp) # Define new executable, list source files
target_link_libraries(mujoco_node mujoco glfw) # Link GLFW libraries to the executable
ament_target_dependencies(mujoco_node rclcpp sensor_msgs std_msgs) # List ROS2 dependencies for this executable
install(TARGETS mujoco_node
DESTINATION lib/${PROJECT_NAME}) # Install so ROS2 can find it
install(DIRECTORY config
launch
model
DESTINATION share/${PROJECT_NAME}) # Install so ROS2 can find them
ament_package()