forked from utexas-bwi/eband_local_planner
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
150 lines (133 loc) · 3.52 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
cmake_minimum_required(VERSION 2.8.3)
project(srl_eband_local_planner)
# Adding definitions
MESSAGE(STATUS "Compiling with maximum optimization, will only work on Core i7 processors! (-mavx -march=corei7-avx -msse4.2 -O3 -funroll-loops -fomit-frame-pointer -ftree-vectorize ...)")
ADD_DEFINITIONS(-march=corei7-avx)
ADD_DEFINITIONS(-mtune=corei7-avx)
ADD_DEFINITIONS(-msse)
ADD_DEFINITIONS(-msse2)
ADD_DEFINITIONS(-msse3)
ADD_DEFINITIONS(-mssse3)
ADD_DEFINITIONS(-msse4.1)
ADD_DEFINITIONS(-msse4.2)
IF($ENV{AVX})
ADD_DEFINITIONS(-mavx)
MESSAGE(STATUS "Compiling with AVX on")
ELSE()
MESSAGE(WARNING "Compiling with AVX off")
ADD_DEFINITIONS(-mno-avx)
ENDIF()
ADD_DEFINITIONS(-O3)
ADD_DEFINITIONS(-funroll-loops)
ADD_DEFINITIONS(-fomit-frame-pointer)
ADD_DEFINITIONS(-pipe)
ADD_DEFINITIONS(-ftree-vectorize)
ADD_DEFINITIONS(-DNDEBUG )
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
else()
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()
set(CMAKE_BUILD_TYPE RelWithDebInfo)
find_package(catkin REQUIRED
COMPONENTS
spencer_control_msgs
std_msgs
base_local_planner
cmake_modules
control_toolbox
costmap_2d
geometry_msgs
sensor_msgs
nav_core
nav_msgs
pluginlib
roscpp
tf
tf_conversions
dynamic_reconfigure
global_planner
cmake_modules
message_generation
)
find_package(Eigen REQUIRED)
include_directories(
include
cfg
${Eigen_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}
)
generate_dynamic_reconfigure_options(
cfg/srl_eband_plannerRos.cfg
)
add_service_files(
DIRECTORY
srv
FILES
EnableSocialLayer.srv
EnableObstacleLayer.srv
)
generate_messages(
DEPENDENCIES
std_msgs
)
catkin_package(
CATKIN_DEPENDS
spencer_tracking_msgs
spencer_control_msgs
std_msgs
base_local_planner
control_toolbox
costmap_2d
geometry_msgs
sensor_msgs
nav_core
nav_msgs
pluginlib
dynamic_reconfigure
roscpp
tf
tf_conversions
global_planner
cmake_modules
message_runtime
INCLUDE_DIRS include
LIBRARIES srl_eband_local_planner
)
if(NOT CMAKE_BUILD_TYPE MATCHES Debug)
# Disable debug and info-level logging statements in release mode
add_definitions(-DROSCONSOLE_MIN_SEVERITY=ROSCONSOLE_SEVERITY_WARN)
else()
add_definitions(-DROSCONSOLE_MIN_SEVERITY=ROSCONSOLE_SEVERITY_DEBUG)
endif()
# build the library
add_library(srl_eband_local_planner
src/srl_eband_local_planner_ros.cpp
src/srl_eband_local_planner.cpp
src/conversions_and_types.cpp
src/srl_eband_visualization.cpp
src/srl_eband_trajectory_controller.cpp
src/context_cost_function.cpp
src/costmap_layers_dyn_rec_handler.cpp
src/check_points_on_path.cpp
)
# add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}_gencfg)
add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(srl_eband_local_planner ${catkin_LIBRARIES})
install(
TARGETS srl_eband_local_planner
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
)
install(
FILES srl_eband_local_planner_plugin.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
PATTERN ".svn" EXCLUDE
)