-
Notifications
You must be signed in to change notification settings - Fork 80
/
Copy pathCMakeLists.txt
141 lines (128 loc) · 3.3 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
cmake_minimum_required(VERSION 2.8.3)
project(lwr_hw)
find_package(catkin REQUIRED COMPONENTS
control_toolbox
controller_interface
controller_manager
hardware_interface
realtime_tools
joint_limits_interface
roscpp
tf
urdf
cmake_modules
pluginlib
kdl_parser
transmission_interface
gazebo_ros
std_msgs
)
add_definitions (-std=c++11)
catkin_package(
CATKIN_DEPENDS
control_toolbox
controller_interface
controller_manager
hardware_interface
realtime_tools
joint_limits_interface
roscpp
tf
urdf
cmake_modules
pluginlib
kdl_parser
transmission_interface
gazebo_ros
std_msgs
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME} lwr_hw_gazebo_plugin friremote
)
###########
## Build ##
###########
include_directories(include
${Boost_INCLUDE_DIR}
${catkin_INCLUDE_DIRS}
)
## LWR HW BASE CLASS
add_library(${PROJECT_NAME}
include/${PROJECT_NAME}/lwr_hw.h
src/lwr_hw.cpp
)
target_link_libraries(${PROJECT_NAME}
${catkin_LIBRARIES}
)
## REAL
# KUKA FRI library
add_library(friremote
src/fri/friremote.cpp
src//fri/friudp.cpp
)
set_target_properties(friremote PROPERTIES COMPILE_DEFINITIONS HAVE_SOCKLEN_T)
# lwr hw fri node
add_executable(lwr_hw_fri_node src/lwr_hw_fri_node.cpp
include/${PROJECT_NAME}/lwr_hw_fri.hpp
)
add_dependencies(lwr_hw_fri_node
friremote
${PROJECT_NAME}
)
target_link_libraries(lwr_hw_fri_node
friremote
${PROJECT_NAME}
${catkin_LIBRARIES}
)
# Standford FRILibrary (support in PROGRESS)
message(WARNING "ATTENTION: This project supports the fork of the Standford library found in https://github.com/iocroblab/fril, and install the libraries in your catkin workspace, not in the system")
include(ExternalProject)
ExternalProject_Add(FRILibrary
GIT_REPOSITORY https://github.com/iocroblab/fril.git
GIT_TAG a10695fad32ba8315817c42020e2dbc66f4505dd
BUILD_COMMAND make
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND cmake -DCMAKE_INSTALL_PREFIX=${CATKIN_DEVEL_PREFIX}
INSTALL_COMMAND make install
)
# lwr hw fril node
include_directories(${CATKIN_DEVEL_PREFIX}/include/fril)
link_directories(${CATKIN_DEVEL_PREFIX}/lib)
add_executable(lwr_hw_fril_node src/lwr_hw_fril_node.cpp
include/${PROJECT_NAME}/lwr_hw_fril.hpp
)
add_dependencies(lwr_hw_fril_node
FRILibrary
${PROJECT_NAME}
)
target_link_libraries(lwr_hw_fril_node
fril
${PROJECT_NAME}
${catkin_LIBRARIES}
)
## SIMULATION
# lwr hw sim gazebo plugin
find_package(gazebo REQUIRED)
include_directories(${GAZEBO_INCLUDE_DIRS})
link_directories(${GAZEBO_LIBRARY_DIRS})
add_library(lwr_hw_gazebo_plugin src/lwr_hw_gazebo_plugin.cpp
include/${PROJECT_NAME}/lwr_hw_gazebo.hpp
)
add_dependencies(lwr_hw_gazebo_plugin
${PROJECT_NAME}
)
target_link_libraries(lwr_hw_gazebo_plugin
${PROJECT_NAME}
${catkin_LIBRARIES}
${GAZEBO_LIBRARIES}
)
## INSTALLATION
install(TARGETS ${PROJECT_NAME} lwr_hw_gazebo_plugin friremote
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION})
install(TARGETS lwr_hw_fri_node
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
install(DIRECTORY launch/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch)
install(DIRECTORY include/cartesian_hardware_interface/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION})