-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
88 lines (71 loc) · 2.68 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
################################################################################
# Set minimum required version of cmake, project name and compile options
################################################################################
cmake_minimum_required(VERSION 3.10.1)
project(hexapod_controller)
## Compile as C++11, supported in ROS Kinetic and newer
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -std=c++0x -lrt")
################################################################################
# Find packages and libraries for catkin and system dependencies
################################################################################
find_package(catkin REQUIRED COMPONENTS
roscpp
std_msgs
nav_msgs
geometry_msgs
tf2
tf2_ros
tf2_geometry_msgs
cmake_modules
)
find_package(Eigen3 REQUIRED)
find_package(jsoncpp REQUIRED)
################################################################################
# Declare catkin specific configuration to be passed to dependent projects
################################################################################
catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS roscpp std_msgs nav_msgs geometry_msgs tf2 tf2_ros tf2_geometry_msgs
LIBRARIES hexapod_robot
)
################################################################################
# Build
################################################################################
set(SOURCE_FILES
src/robot.cpp
src/leg.cpp
)
include_directories(
include/
${EIGEN3_INCLUDE_DIRS}
${JSONCPP_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}
)
#add_library(robot ${SOURCE_FILES})
add_library(hexapod_robot STATIC ${SOURCE_FILES})
## Declare a C++ executable
add_executable(hexapod_controller src/main.cpp)
## Add cmake target dependencies of the executable
## Specify libraries to link a library or executable target against
target_link_libraries(hexapod_controller
hexapod_robot
${catkin_LIBRARIES}
${EIGEN3_LIBS}
jsoncpp
)
## Add cmake target dependencies of the executable
#add_dependencies(dynamixel_sdk ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
#target_link_libraries(dynamixel_sdk ${catkin_LIBRARIES})
################################################################################
# Install
################################################################################
install(TARGETS hexapod_robot hexapod_controller
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(DIRECTORY include
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)
install(DIRECTORY config launch
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})