-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
111 lines (95 loc) · 2.58 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
cmake_minimum_required(VERSION 3.8)
project(guidance_planner)
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()
find_package(OpenMP)
if(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}")
else()
message(WARNING "Compiling without OPENMP")
endif()
set(DEPENDENCIES
roscpp
std_msgs
ros_tools
dynamic_reconfigure
)
find_package(catkin REQUIRED COMPONENTS
${DEPENDENCIES}
)
find_package(Eigen3 REQUIRED)
add_definitions(${EIGEN_DEFINITIONS})
# ADD GSL FOR HOMOTOPY
find_package(PkgConfig REQUIRED)
pkg_check_modules(gsl REQUIRED gsl)
generate_dynamic_reconfigure_options(
cfg/GuidancePlannerReconfigure.cfg
)
catkin_package(
CATKIN_DEPENDS ${DEPENDENCIES}
INCLUDE_DIRS include ${EIGEN3_INCLUDE_DIRS}
LIBRARIES ${PROJECT_NAME} ${PROJECT_NAME}_homotopy ${gsl_LIBRARIES}
DEPENDS EIGEN3
)
include_directories(
include
debug
${catkin_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIRS}
)
add_library(${PROJECT_NAME}_homotopy SHARED
src/homotopy_comparison/uvd.cpp
src/homotopy_comparison/winding_angle.cpp
src/homotopy_comparison/homology.cpp
)
add_dependencies(${PROJECT_NAME}_homotopy ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(${PROJECT_NAME}_homotopy
${catkin_LIBRARIES}
${gsl_LIBRARIES}
)
# Library
add_library(${PROJECT_NAME} SHARED
src/config.cpp
src/global_guidance.cpp
src/prm.cpp
src/sampler.cpp
src/graph.cpp
src/graph_search.cpp
src/types/paths.cpp
src/types/types.cpp
src/types/node.cpp
src/types/connection.cpp
src/environment.cpp
src/cubic_spline.cpp
src/third_party/dubins.cpp
)
add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS} ${PROJECT_NAME}_gencfg)
target_link_libraries(${PROJECT_NAME}
${catkin_LIBRARIES}
${PROJECT_NAME}_homotopy
)
# Example
add_executable(example
src/ros1_example.cpp
)
add_dependencies(example ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS} ${PROJECT_NAME}_gencfg)
target_link_libraries(example
${PROJECT_NAME}_homotopy
${PROJECT_NAME}
${catkin_LIBRARIES}
)
add_definitions(-DMPC_PLANNER_ROS)
install(TARGETS
${PROJECT_NAME}_homotopy
${PROJECT_NAME}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
)
install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
PATTERN ".svn" EXCLUDE
)