-
Notifications
You must be signed in to change notification settings - Fork 140
/
CMakeLists.txt
71 lines (58 loc) · 1.64 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
cmake_minimum_required(VERSION 3.10)
project(hybrid_a_star)
message(STATUS "Hybrid A star")
message(STATUS "Author: Zhang Zhimeng")
#set(CMAKE_VERBOSE_MAKEFILE "true")
# Compiler
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(FATAL_ERROR "The compiler ${CMAKE_CXX_FLAGS} doesn't have C++11 support.
Please use a different C++ compiler")
endif ()
set(ADDITIONAL_CXX_FLAG "-Wall -O3 -march=native")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ADDITIONAL_CXX_FLAG}")
# Eigen
include(cmake/FindEigen.cmake)
include_directories(${EIGEN_INCLUDE_DIR})
# glog
include(cmake/glog.cmake)
include_directories(${GLOG_INCLUDE_DIRS})
# catkin
find_package(
catkin REQUIRED COMPONENTS
nav_msgs
roscpp
tf
)
include_directories(
include
${catkin_INCLUDE_DIRS}
)
catkin_package(
# INCLUDE_DIRS include
# LIBRARIES path_searcher
# CATKIN_DEPENDS nav_mags roscpp tf
# DEPENDS system_lib
)
add_library(
PATH_SEARCHER_LIB SHARED
src/rs_path.cpp
src/costmap_subscriber.cpp
src/goal_pose_subscriber.cpp
src/init_pose_subscriber.cpp
src/hybrid_a_star.cpp
src/hybrid_a_star_flow.cpp
)
target_link_libraries(
PATH_SEARCHER_LIB
${catkin_LIBRARIES}
${GLOG_LIBRARIES}
)
add_executable(run_hybrid_astar app/run_hybrid_astar.cpp)
target_link_libraries(run_hybrid_astar PATH_SEARCHER_LIB)