-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
67 lines (56 loc) · 1.66 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
cmake_minimum_required(VERSION 3.0.2)
project(ase389)
## Compile as C++14, supported in ROS Melodic and newer
add_compile_options(-std=c++14)
# This line ensures we can find RBDL with the FindRBDL.cmake file in the source directory
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
# ROS dependencies
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
gazebo_ros
sensor_msgs
)
# Non-ROS dependencies
find_package(Eigen3 REQUIRED)
find_package(RBDL COMPONENTS URDFReader REQUIRED)
find_package(osqp REQUIRED)
# Set all our include paths to a single variable INCLUDES for ease of access
set(INCLUDES
include
${catkin_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}/eigen3
)
# Create a catkin package, allowing this project to be included in other projects
catkin_package(
INCLUDE_DIRS ${INCLUDES}
LIBRARIES ${PROJECT_NAME}
CATKIN_DEPENDS roscpp std_msgs
DEPENDS RBDL Eigen3
)
# Create a library for our class to be accesible to other packages
add_library(ase389
src/PupperCplusplusController/PupperModel.cpp
src/PupperCplusplusController/PupperWBC.cpp
)
# Link all necessary libraries to out library
target_link_libraries(${PROJECT_NAME}
${catkin_LIBRARIES}
osqp::osqp
${RBDL_LIBRARY}
${RBDL_URDFReader_LIBRARY}
)
# Specify include directories
include_directories(
${INCLUDES}
)
# Create an executable file and link its dependencies
add_executable(PupperController
src/PupperCplusplusController/PupperControl.cpp
)
target_link_libraries(PupperController ${PROJECT_NAME})
# ROS node for controlling the real life pupper
add_executable(PupperNode
src/PupperCplusplusController/pupper_ros_node.cpp
)
target_link_libraries(PupperNode ${PROJECT_NAME})