-
Notifications
You must be signed in to change notification settings - Fork 58
/
CMakeLists.txt
145 lines (109 loc) · 3.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
cmake_minimum_required(VERSION 2.8.3)
project(srl_global_planner)
ADD_DEFINITIONS(-std=c++0x) # C++ 11 is required
# 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)
set(CMAKE_BUILD_TYPE RelWithDebInfo)
find_package(catkin REQUIRED COMPONENTS
geometry_msgs
nav_core
nav_msgs
spencer_tracking_msgs
spencer_nav_msgs
spencer_control_msgs
pluginlib
costmap_2d
navfn
global_planner
roscpp
rospy
std_msgs
tf
visualization_msgs
)
find_package(cmake_modules REQUIRED)
# add qt4 to the project
FIND_PACKAGE(Eigen REQUIRED)
FIND_PACKAGE(Boost REQUIRED)
catkin_package(
CATKIN_DEPENDS
geometry_msgs
nav_core
nav_msgs
roscpp
rospy
std_msgs
tf
visualization_msgs
costmap_2d
pluginlib
navfn
global_planner
spencer_tracking_msgs
spencer_nav_msgs
spencer_control_msgs
LIBRARIES
srl_global_planner
)
FIND_PACKAGE( OpenMP REQUIRED)
if(OPENMP_FOUND)
message("OPENMP FOUND")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()
###########
## Build ##
###########
include_directories(${Eigen_INCLUDE_DIRS})
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/include/
${CMAKE_CURRENT_SOURCE_DIR}/src/
${CMAKE_CURRENT_SOURCE_DIR}
${catkin_INCLUDE_DIRS}
)
# RRT PLANNER
## Declare KdTree lib
add_library(SRLGLOBALPLANNER_KDTREE_LIB ${CMAKE_CURRENT_SOURCE_DIR}/include/smp/external_libraries/kdtree/kdtree.c)
# Setting SOURCES variables
set(SOURCES_RRT src/srl_global_planner.cpp include/srl_global_planner/srl_global_planner.h)
set(SOURCES
src/costmap_layers_dyn_rec_handler.cpp include/srl_global_planner/costmap_layers_dyn_rec_handler.h src/thetastar_leading_rrt.cpp include/srl_global_planner/thetastar_leading_rrt.h include/srl_global_planner/costmap_model.cpp include/srl_global_planner/trajectory.cpp include/srl_global_planner/grid.cpp include/srl_global_planner/cell.cpp
)
# Plugin
add_library(srl_global_planner ${SOURCES_RRT} ${SOURCES})
target_link_libraries(srl_global_planner ${catkin_LIBRARIES} ${BOOST_LIBRARIES} SRLGLOBALPLANNER_KDTREE_LIB)
add_dependencies(srl_global_planner srl_global_planner_gencfg ${catkin_EXPORTED_TARGETS})
add_dependencies(srl_global_planner nav_msgs_gencpp)
install(TARGETS srl_global_planner
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
)
install(FILES srl_global_planner_plugin.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
PATTERN ".svn" EXCLUDE
)