-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
156 lines (139 loc) · 4.76 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
PROJECT(spot_autonomy)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
SET(CMAKE_AUTOMOC ON)
SET(CMAKE_AUTORCC ON)
SET(CMAKE_AUTOUIC ON)
SET(CMAKE_CXX_FLAGS "-march=native -Wall -Werror -g -Wno-unused-function")
set(CMAKE_CXX_STANDARD 14)
IF(${CMAKE_BUILD_TYPE} MATCHES "Release")
MESSAGE(STATUS "Additional Flags for Release mode")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp -fno-builtin-malloc \
-fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -O3 -DNDEBUG")
SET(BUILD_SPECIFIC_LIBRARIES "tcmalloc")
ELSEIF(${CMAKE_BUILD_TYPE} MATCHES "Debug")
MESSAGE(STATUS "Additional Flags for Debug mode")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
SET(BUILD_SPECIFIC_LIBRARIES "")
ENDIF()
MESSAGE(STATUS "SOURCE DIR: ${PROJECT_SOURCE_DIR}")
# Qt setup (needs to precede executable)
set(CMAKE_AUTOMOC on)
set(CMAKE_AUTORCC on)
set(CMAKE_AUTOUIC on)
set(CMAKE_INCLUDE_CURRENT_DIR on)
find_package(Qt5 COMPONENTS Core Widgets WebSockets REQUIRED)
FIND_PACKAGE(Lua51 REQUIRED)
FIND_PACKAGE(Eigen3 REQUIRED)
FIND_PACKAGE(Ceres REQUIRED)
INCLUDE($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
ROSBUILD_INIT()
SET(ROS_BUILD_STATIC_LIBS true)
SET(ROS_BUILD_SHARED_LIBS false)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR})
ADD_SUBDIRECTORY(amrl_shared_lib)
ROSBUILD_ADD_EXECUTABLE(enml
enml/src/non_markov_localization_main.cpp
enml/src/non_markov_localization.cpp
enml/src/kdtree.cpp
enml/src/perception_2d.cpp
enml/src/vector_map/vector_map.cc
enml/src/visualization/visualization.cc
enml/src/visualization/gui_helpers.cc)
TARGET_INCLUDE_DIRECTORIES(enml PRIVATE
amrl_shared_lib
config_reader/include
enml/src
enml/src/shared
enml/src/config-reader/include
${LUA_INCLUDE_DIR}
${CERES_INCLUDE_DIRS})
ADD_DEPENDENCIES(enml rosbuild_precompile)
TARGET_LINK_LIBRARIES(enml ceres roslib roscpp ncurses pthread boost_system
${LUA_LIBRARIES} rt popt glog rosbag amrl_shared_lib
${BUILD_SPECIFIC_LIBRARIES})
ROSBUILD_ADD_EXECUTABLE(joystick
joystick/joystick_driver.cc
joystick/joystick.cc)
TARGET_INCLUDE_DIRECTORIES(joystick PRIVATE
config_reader/include
amrl_shared_lib)
TARGET_LINK_LIBRARIES(joystick gflags roslib roscpp pthread boost_system
rt glog rosbag amrl_shared_lib ${LUA_LIBRARIES}
${BUILD_SPECIFIC_LIBRARIES})
ROSBUILD_ADD_EXECUTABLE(status_translator
status_translator/status_translator.cc)
TARGET_INCLUDE_DIRECTORIES(status_translator PRIVATE
amrl_shared_lib)
TARGET_LINK_LIBRARIES(status_translator gflags roslib
roscpp pthread boost_system
rt glog rosbag amrl_shared_lib
${BUILD_SPECIFIC_LIBRARIES})
ROSBUILD_ADD_EXECUTABLE(websocket
webviz/src/websocket/websocket_main.cc
webviz/src/websocket/websocket.cc)
TARGET_INCLUDE_DIRECTORIES(websocket PRIVATE
amrl_shared_lib
webviz/src)
TARGET_LINK_LIBRARIES(websocket
Qt5::Core
Qt5::Widgets
Qt5::WebSockets
glog
gflags
amrl_shared_lib
${BUILD_SPECIFIC_LIBRARIES})
ROSBUILD_ADD_EXECUTABLE(pointcloud_to_laserscan
pointcloud_to_laserscan/pointcloud_to_laserscan_main.cc)
TARGET_INCLUDE_DIRECTORIES(pointcloud_to_laserscan PRIVATE
config_reader/include
amrl_shared_lib
${LUA_INCLUDE_DIR})
TARGET_LINK_LIBRARIES(pointcloud_to_laserscan
glog
gflags
amrl_shared_lib
roscpp
${LUA_LIBRARIES}
${BUILD_SPECIFIC_LIBRARIES})
INCLUDE_DIRECTORIES(robofleet_client/robofleet_client_lib)
INCLUDE_DIRECTORIES(robofleet_client/robofleet_client_lib/include)
ROSBUILD_ADD_EXECUTABLE(robofleet_client
robofleet_client/src/main.cpp)
TARGET_SOURCES(robofleet_client PRIVATE
robofleet_client/src/main.cpp
robofleet_client/src/encode_ros.hpp
robofleet_client/src/decode_ros.hpp
robofleet_client/src/WsClient.hpp
robofleet_client/src/WsServer.hpp
robofleet_client/src/WebVizConstants.hpp
robofleet_client/src/RosClientNode.hpp
robofleet_client/src/MessageScheduler.hpp
)
TARGET_INCLUDE_DIRECTORIES(robofleet_client PRIVATE
robofleet_client/src
robofleet_client/include
amrl_shared_lib
config/robofleet_client
${LUA_INCLUDE_DIR})
TARGET_LINK_LIBRARIES(robofleet_client
Qt5::Core
Qt5::Widgets
Qt5::WebSockets
glog
gflags
amrl_shared_lib
roscpp
${LUA_LIBRARIES}
${BUILD_SPECIFIC_LIBRARIES})
# ROSBUILD_ADD_EXECUTABLE(gps_translator
# gps/gps_translator.cc
# visualization/visualization.cc)
# TARGET_INCLUDE_DIRECTORIES(gps_translator PRIVATE
# shared_lib
# config_reader/include
# ${LUA_INCLUDE_DIR})
# TARGET_LINK_LIBRARIES(gps_translator gflags roslib roscpp pthread boost_system
# rt glog rosbag amrl_shared_lib ${LUA_LIBRARIES}
# ${BUILD_SPECIFIC_LIBRARIES})