forked from tue-robotics/ed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
180 lines (141 loc) · 5.41 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
cmake_minimum_required(VERSION 2.8.3)
project(ed)
## Compile as C++11, supported in ROS Kinetic and newer
add_compile_options(-std=c++11)
## Find catkin macros and libraries
find_package(catkin REQUIRED COMPONENTS
cmake_modules
class_loader
code_profiler
cv_bridge
ed_msgs
geolib2
kdl_parser
rgbd
pcl_ros
roscpp
tue_config
tue_filesystem
tue_serialization
)
find_package(orocos_kdl REQUIRED)
find_package(PCL REQUIRED)
find_package(OpenCV REQUIRED)
find_package(TinyXML REQUIRED)
find_package(SDFormat REQUIRED)
###################################
## catkin specific configuration ##
###################################
catkin_package(
INCLUDE_DIRS include
LIBRARIES ed_core ed_io ed_visualization
CATKIN_DEPENDS class_loader cv_bridge code_profiler ed_msgs tue_config tue_serialization rgbd
DEPENDS OpenCV
)
###########
## Build ##
###########
add_compile_options(-Wreturn-type)
add_compile_options(-Wsign-compare)
add_compile_options(-Wreorder)
include_directories(
include
3rdparty
${TinyXML_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
${SDFormat_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}
)
# ------------------------------------------------------------------------------------------------
# ED CORE
# ------------------------------------------------------------------------------------------------
# Get all the headers
file(GLOB_RECURSE HEADER_FILES include/*.h)
# Declare a cpp library
add_library(ed_core
src/entity.cpp
src/measurement.cpp
src/world_model.cpp
src/transform_cache.cpp
src/convex_hull_2d.cpp
src/convex_hull_calc.cpp
# World model querying
src/world_model/transform_crawler.cpp
# Model loading
src/models/model_loader.cpp
src/models/shape_loader.cpp
src/models/xml_shape_parser.cpp
3rdparty/polypartition/polypartition.cpp
# DDP is used by measurement.cpp, so put here
src/helpers/depth_data_processing.cpp
src/helpers/clipper/clipper.cpp
# Logging
src/logging.cpp
src/error_context.cpp
${HEADER_FILES}
)
target_link_libraries(ed_core ${TinyXML_LIBRARIES} ${PCL_LIBRARIES} ${SDFormat_LIBRARIES} ${catkin_LIBRARIES})
add_library(ed_io
src/serialization/serialization.cpp
src/io/filesystem/read.cpp
src/io/filesystem/write.cpp
src/io/transport/probe.cpp
src/io/transport/probe_ros.cpp
src/io/transport/probe_client.cpp
src/io/json_reader.cpp
)
target_link_libraries(ed_io ed_core)
add_library(ed_visualization
include/ed/helpers/image_publisher.h
src/helpers/image_publisher.cpp
)
target_link_libraries(ed_visualization ${catkin_LIBRARIES})
# ------------------------------------------------------------------------------------------------
# SERVER
# ------------------------------------------------------------------------------------------------
# Create executable
add_executable(ed
src/ed.cpp
src/server.cpp
src/plugin_container.cpp
)
target_link_libraries(ed ed_core ed_io ed_visualization)
# ------------------------------------------------------------------------------------------------
# PLUGINS
# ------------------------------------------------------------------------------------------------
add_library(ed_tf_publisher_plugin plugins/tf_publisher_plugin.cpp)
find_package(kdl_parser REQUIRED)
add_library(ed_robot_plugin plugins/robot_plugin.cpp)
target_link_libraries(ed_robot_plugin ${kdl_parser_LIBRARIES})
add_library(ed_sync_plugin plugins/sync_plugin.cpp)
target_link_libraries(ed_sync_plugin ${catkin_LIBRARIES})
# ------------------------------------------------------------------------------------------------
# TOOLS
# ------------------------------------------------------------------------------------------------
add_executable(ed_view_model tools/view_model.cpp)
target_link_libraries(ed_view_model ed_core)
add_executable(ed_heightmap_to_mesh tools/heightmap_to_mesh.cpp)
target_link_libraries(ed_heightmap_to_mesh ed_core)
#add_executable(ed_repl tools/repl.cpp)
#target_link_libraries(ed_repl readline)
# ------------------------------------------------------------------------------------------------
# EXAMPLES
# ------------------------------------------------------------------------------------------------
add_library(ed_hello_world_plugin examples/hello_world/hello_world_plugin.cpp)
add_library(ed_custom_properties_plugin examples/custom_properties/custom_properties_plugin.cpp)
# ------------------------------------------------------------------------------------------------
# TESTS
# ------------------------------------------------------------------------------------------------
add_executable(ed_test_wm test/test_wm.cpp)
target_link_libraries(ed_test_wm ed_core ${OpenCV_LIBRARIES})
add_executable(test_mask test/test_mask.cpp)
target_link_libraries(test_mask ed_core ${OpenCV_LIBRARIES})
add_executable(test_service_speed test/test_service_speed.cpp)
target_link_libraries(test_service_speed ed_core)
add_executable(show_gui test/show_gui.cpp)
target_link_libraries(show_gui ed_core ${OpenCV_LIBRARIES})
add_executable(ed_test_heightmap_triangulation
test/test_heightmap_triangulation.cpp
3rdparty/polypartition/polypartition.cpp
)
target_link_libraries(ed_test_heightmap_triangulation ed_core ${OpenCV_LIBRARIES} ${geolib2_LIBRARIES} ${tue_config_LIBRARIES})