forked from stack-of-tasks/dynamic_graph_bridge
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
164 lines (134 loc) · 5.47 KB
/
CMakeLists.txt
File metadata and controls
164 lines (134 loc) · 5.47 KB
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# Copyright (C) 2008-2013 LAAS-CNRS, JRL AIST-CNRS.
#
# Author: Florent Lamiraux, Nirmal Giftsun
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Catkin part
cmake_minimum_required(VERSION 2.4.6)
project(dynamic_graph_bridge)
find_package(catkin REQUIRED COMPONENTS roscpp rospy std_msgs message_generation std_srvs geometry_msgs sensor_msgs tf realtime_tools)
find_package(Boost REQUIRED COMPONENTS program_options)
add_message_files(FILES Matrix.msg Vector.msg)
add_service_files(FILES RunCommand.srv)
generate_messages(
DEPENDENCIES
dynamic_graph_bridge
std_msgs
)
catkin_package(CATKIN_DEPENDS message_runtime)
## LAAS cmake submodule part
set(PROJECT_DESCRIPTION "Dynamic graph bridge library")
set(PROJECT_NAME dynamic_graph_bridge)
set(PROJECT_URL "")
set(CXX_DISABLE_WERROR False)
set(CUSTOM_HEADER_DIR dynamic_graph_bridge)
set(${PROJECT_NAME}_HEADERS
include/dynamic_graph_bridge/ros_init.hh
include/dynamic_graph_bridge/ros_interpreter.hh
)
include(cmake/base.cmake)
include(cmake/GNUInstallDirs.cmake)
include(cmake/python.cmake)
SETUP_PROJECT()
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
set(CMAKE_INSTALL_RPATH "${LIBRARY_OUTPUT_PATH}")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${LIBRARY_OUTPUT_PATH}")
set(PKG_CONFIG_ADDITIONAL_VARIABLES
${PKG_CONFIG_ADDITIONAL_VARIABLES}
plugindirname
plugindir
)
add_required_dependency(roscpp)
add_required_dependency("realtime_tools >= 1.8")
add_required_dependency(bullet)
add_required_dependency(jrl-mal)
add_required_dependency(dynamic-graph)
add_required_dependency(dynamic-graph-python)
add_required_dependency(sot-core)
add_required_dependency(sot-dynamic)
add_required_dependency(jrl-dynamics-urdf)
add_library(ros_bridge
src/converter.hh
include/dynamic_graph_bridge/ros_init.hh src/ros_init.cpp
src/sot_to_ros.hh src/sot_to_ros.cpp
)
pkg_config_use_dependency(ros_bridge jrl-mal)
pkg_config_use_dependency(ros_bridge bullet)
install(TARGETS ros_bridge DESTINATION lib)
# Make sure rpath are preserved during the install as ROS dependencies
# are not installed.
set_target_properties(ros_bridge PROPERTIES BUILD_WITH_INSTALL_RPATH True)
macro(compile_plugin NAME)
message(lib path ${LIBRARY_OUTPUT_PATH})
file(MAKE_DIRECTORY "${LIBRARY_OUTPUT_PATH}/dynamic_graph/ros/${NAME}")
add_library(${NAME} src/${NAME}.cpp src/${NAME}.hh)
pkg_config_use_dependency(${NAME} jrl-mal)
pkg_config_use_dependency(${NAME} dynamic-graph)
pkg_config_use_dependency(${NAME} sot-core)
pkg_config_use_dependency(${NAME} jrl-dynamics-urdf)
add_dependencies(${NAME} ros_bridge)
target_link_libraries(${NAME} ros_bridge)
set_target_properties(${NAME} PROPERTIES BUILD_WITH_INSTALL_RPATH True)
install(TARGETS ${NAME} DESTINATION lib)
dynamic_graph_python_module("ros/${NAME}"
${NAME}
ros/${NAME}/wrap
)
PKG_CONFIG_USE_DEPENDENCY(ros/${NAME}/wrap realtime_tools)
PKG_CONFIG_USE_DEPENDENCY(ros/${NAME}/wrap jrl-mal)
PKG_CONFIG_USE_DEPENDENCY(ros/${NAME}/wrap dynamic_graph)
PKG_CONFIG_USE_DEPENDENCY(ros/${NAME}/wrap sot-core)
endmacro()
include(cmake/python.cmake)
compile_plugin(ros_publish)
compile_plugin(ros_subscribe)
compile_plugin(ros_time)
compile_plugin(ros_joint_state)
target_link_libraries(ros_joint_state "${DYNAMIC_GRAPH_PLUGINDIR}/dynamic.so")
compile_plugin(robot_model)
# ros_interperter library.
add_library(ros_interpreter src/ros_interpreter.cpp)
pkg_config_use_dependency(ros_interpreter jrl-mal)
pkg_config_use_dependency(ros_interpreter dynamic-graph)
pkg_config_use_dependency(ros_interpreter sot-core)
pkg_config_use_dependency(ros_interpreter roscpp)
add_dependencies(ros_interpreter ros_bridge)
target_link_libraries(ros_interpreter ros_bridge)
set_target_properties(ros_interpreter PROPERTIES BUILD_WITH_INSTALL_RPATH True)
message(cmakeinstalllibdir ${CMAKE_INSTALL_LIBDIR} )
install(TARGETS ros_interpreter DESTINATION ${CMAKE_INSTALL_LIBDIR})
# Stand alone remote dynamic-graph Python interpreter.
add_executable(interpreter src/interpreter.cpp)
add_dependencies(interpreter ros_interpreter)
target_link_libraries(interpreter ros_interpreter)
pkg_config_use_dependency(interpreter jrl-mal)
pkg_config_use_dependency(interpreter dynamic-graph)
pkg_config_use_dependency(interpreter sot-core)
pkg_config_use_dependency(interpreter sot-dynamic)
# set_target_properties(interpreter PROPERTIES BUILD_WITH_INSTALL_RPATH True)
#install(TARGETS interpreter DESTINATION bin)
# Stand alone embedded intepreter with a robot controller.
add_executable(geometric_simu src/geometric_simu.cpp src/sot_loader.cpp)
pkg_config_use_dependency(geometric_simu roscpp)
target_link_libraries(geometric_simu ${Boost_LIBRARIES})
add_subdirectory(src)
#install ros executables
install(PROGRAMS
${CMAKE_SOURCE_DIR}/scripts/robot_pose_publisher
${CMAKE_SOURCE_DIR}/scripts/run_command
${CMAKE_SOURCE_DIR}/scripts/tf_publisher
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
SETUP_PROJECT_FINALIZE()