forked from KITrobotics/force_torque_sensor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
122 lines (104 loc) · 3.15 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
cmake_minimum_required(VERSION 2.8.3)
project(force_torque_sensor)
## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
cmake_modules
dynamic_reconfigure
geometry_msgs
hardware_interface
iirob_filters
pluginlib
realtime_tools
roscpp
rosparam_handler
rospy
std_msgs
std_srvs
tf2
tf2_geometry_msgs
tf2_ros
)
find_package(Eigen3)
if(NOT EIGEN3_FOUND)
# Fallback to cmake_modules
find_package(cmake_modules REQUIRED)
find_package(Eigen REQUIRED)
set(Eigen3_INCLUDE_DIRS ${Eigen_INCLUDE_DIRS})
set(Eigen3_LIBRARIES ${Eigen_LIBRARIES})
else()
set(Eigen3_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR})
set(Eigen3_LIBRARIES ${EIGEN3_LIBRARIES})
endif()
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" Cpp11CompilerFlag)
if (${Cpp11CompilerFlag})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif()
generate_ros_parameter_files(
cfg/CoordinateSystemCalibration.params
cfg/HWCommunicationConfiguration.params
cfg/FTSConfiguration.params
cfg/NodeConfiguration.params
cfg/PublishConfiguration.params
cfg/Calibration.params
)
add_service_files(
FILES
CalculateAverageMasurement.srv
CalculateSensorOffset.srv
DiagnosticVoltages.srv
SetSensorOffset.srv
)
generate_messages(
DEPENDENCIES
geometry_msgs
std_msgs
)
###################################
## catkin specific configuration ##
###################################
catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS geometry_msgs iirob_filters message_runtime roscpp std_msgs std_srvs rospy realtime_tools pluginlib tf2 tf2_ros
DEPENDS Eigen3
LIBRARIES ${PROJECT_NAME} ${PROJECT_NAME}_sim
)
###########
## Build ##
###########
## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
include
${catkin_INCLUDE_DIRS}
${Eigen3_INCLUDE_DIRS}
)
add_library(${PROJECT_NAME} src/force_torque_sensor_handle.cpp )
add_dependencies(${PROJECT_NAME}
${PROJECT_NAME}_gencfg # For dynamic_reconfigure
${PROJECT_NAME}_generate_messages_cpp
${PROJECT_NAME}_genparam # For rosparam_handler
)
target_link_libraries(${PROJECT_NAME} ${catkin_LIBRARIES} ${Eigen3_LIBRARIES})
add_library(${PROJECT_NAME}_sim src/force_torque_sensor_sim.cpp )
target_link_libraries(${PROJECT_NAME}_sim ${catkin_LIBRARIES} ${Eigen3_LIBRARIES})
add_executable(${PROJECT_NAME}_node src/force_torque_sensor_node.cpp)
target_link_libraries(${PROJECT_NAME}_node ${PROJECT_NAME} ${catkin_LIBRARIES} ${Eigen3_LIBRARIES})
#############
## Install ##
#############
install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_sim ${PROJECT_NAME}_node
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)
install(DIRECTORY config/ cfg/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
install(FILES force_torque_sensor_plugin.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})