-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
169 lines (115 loc) · 3.56 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
cmake_minimum_required(VERSION 3.11)
project(gsl_server)
set(CMAKE_BUILD_TYPE "None")
set(CMAKE_CXX_FLAGS "-std=c++20 -g ${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_STANDARD 20)
#OPTIONS
##############################################################################
set(GSL_DEBUG OFF) #enabling debug mode disables optimizations and activates a bunch of assertions in the code.
set(GSL_TRACING ON) #extra logging to tell you what is being executed
set(USE_GADEN ON) #if ON, the code is compiled with support for directly querying gaden simulations to obtain the wind ground truth. If you dont have gaden in this workspace, you need to set this to OFF or it wont compile (duh)
set(USE_NAV_ASSISTANT OFF) # if ON uses the nav_assistant package rather than directly communicating with nav_2. It adds some extra features, but currently it has a relatively high performance cost due to async inter-process communication
# Compile graphical interface with DearImGUI. Currently only affects the PMFS algorithm. Not required to function, it is mostly for debugging purposes
set(USE_GUI OFF)
##############################################################################
if(GSL_DEBUG)
add_definitions(-DGSL_DEBUG=1)
set(CMAKE_CXX_FLAGS "-O0 ${CMAKE_CXX_FLAGS}")
else()
set(CMAKE_CXX_FLAGS "-O3 ${CMAKE_CXX_FLAGS}")
endif(GSL_DEBUG)
#ament packages
find_package(rclcpp REQUIRED)
find_package(rclcpp_action REQUIRED)
find_package(tf2 REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(tf2_geometry_msgs REQUIRED)
find_package(angles REQUIRED)
find_package(olfaction_msgs REQUIRED)
find_package(visualization_msgs REQUIRED)
find_package(gmrf_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(std_msgs REQUIRED)
find_package(nav2_msgs REQUIRED)
find_package(gsl_actions REQUIRED)
if(GSL_TRACING)
add_definitions(-DGSL_TRACING=1)
endif(GSL_TRACING)
if(USE_GADEN)
add_definitions(-DUSE_GADEN)
find_package(gaden_player REQUIRED)
set(CONDITIONAL_GADEN_PLAYER "gaden_player")
else()
set(CONDITIONAL_GADEN_PLAYER "")
endif(USE_GADEN)
if(USE_NAV_ASSISTANT)
add_definitions(-DUSE_NAV_ASSISTANT)
find_package(nav_assistant_msgs REQUIRED)
set(CONDITIONAL_NAV_ASSISTANT "nav_assistant_msgs")
endif()
#other stuff
find_package(OpenMP REQUIRED)
find_package(OpenCV REQUIRED)
find_package(fmt REQUIRED)
if(USE_GUI)
add_definitions(-DUSE_GUI)
find_package(ament_imgui REQUIRED)
set(CONDITIONAL_IMGUI "ament_imgui")
endif(USE_GUI)
###########
## INCLUDES
###########
include_directories(
include
third_party/glm
third_party/StateMachine/include
)
###########
## SOURCES
###########
file(GLOB_RECURSE SOURCES_SERVER "src/server/*.cpp")
###########
#DECLARE EXECUTABLES
###########
add_executable(gsl_actionserver_node ${SOURCES_SERVER})
add_executable(gsl_actionserver_call src/gsl_server_call.cpp)
ament_target_dependencies( gsl_actionserver_node
rclcpp
rclcpp_action
geometry_msgs
tf2
tf2_ros
tf2_geometry_msgs
angles
olfaction_msgs
visualization_msgs
nav2_msgs
std_msgs
gmrf_msgs
gsl_actions
${CONDITIONAL_NAV_ASSISTANT}
${CONDITIONAL_GADEN_PLAYER}
${CONDITIONAL_IMGUI}
)
ament_target_dependencies( gsl_actionserver_call
rclcpp
rclcpp_action
gsl_actions
)
###########
#LINK
###########
target_link_libraries(gsl_actionserver_node
${OpenCV_LIBS}
OpenMP::OpenMP_CXX
fmt
)
install(
TARGETS gsl_actionserver_node gsl_actionserver_call
DESTINATION lib/${PROJECT_NAME}
)
install(
DIRECTORY resources
DESTINATION share/${PROJECT_NAME}
)
ament_package()