-
Notifications
You must be signed in to change notification settings - Fork 9
/
CMakeLists.txt
106 lines (85 loc) · 2.22 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
cmake_minimum_required(VERSION 3.0.2)
project(jps_global_planner)
add_compile_options(-std=c++11)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo)
endif()
set(BUILD_SHARED_LIBS ON)
find_package(jps3d REQUIRED)
find_package(catkin REQUIRED COMPONENTS
base_local_planner
costmap_2d
geometry_msgs
nav_core
pluginlib
roscpp
roslint
std_msgs
)
find_package(PkgConfig REQUIRED)
pkg_check_modules(YAMLCPP REQUIRED yaml-cpp)
if(YAMLCPP_FOUND)
message(STATUS "Found yaml-cpp.")
else()
message(FATAL_ERROR "Could not find yaml-cpp.")
endif()
###################################
## catkin specific configuration ##
###################################
catkin_package(
LIBRARIES
jps_ros
CATKIN_DEPENDS
base_local_planner
costmap_2d
geometry_msgs
nav_core
pluginlib
roscpp
std_msgs
DEPENDS
jps3d
)
###########
## Build ##
###########
include_directories(
include
${catkin_INCLUDE_DIRS}
${JPS3D_INCLUDE_DIRS}
)
add_library (jps_planner_ros src/jps_ros.cpp)
target_link_libraries(jps_planner_ros ${catkin_LIBRARIES} ${JPS3D_LIBRARIES})
add_dependencies(jps_planner_ros ${catkin_EXPORTED_TARGETS})
add_executable(${PROJECT_NAME} src/jps_node.cpp)
target_link_libraries(${PROJECT_NAME} jps_planner_ros ${JPS3D_LIBRARIES} ${catkin_LIBRARIES})
#############
## Install ##
#############
install(TARGETS
${PROJECT_NAME}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
install(TARGETS
jps_planner_ros
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}
)
install(DIRECTORY
plugins
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
#############
## Testing ##
#############
add_executable(${PROJECT_NAME}_test test/test_distance_map_planner_2d.cpp)
target_link_libraries(${PROJECT_NAME}_test ${JPS3D_LIBRARIES} ${YAMLCPP_LIBRARIES} ${Boost_LIBRARIES})
add_test(test_distance_map_planner_2d ${PROJECT_NAME}_test ${CMAKE_SOURCE_DIR}/test/data/corridor.yaml)
set(ROSLINT_CPP_OPTS "--filter=-build/c++11,-build/header_guard")
roslint_cpp()
roslint_add_test()