-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathCMakeLists.txt
102 lines (81 loc) · 3.51 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
PROJECT(graph_navigation)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
MESSAGE(STATUS "Compiling Navigation")
MESSAGE(STATUS "Using compiler: ${CMAKE_CXX_COMPILER}")
MESSAGE(STATUS "Build Type: ${CMAKE_BUILD_TYPE}")
MESSAGE(STATUS "Arch: ${CMAKE_SYSTEM_PROCESSOR}")
SET(CMAKE_CXX_FLAGS "-std=c++17 -Wall -Werror")
SET(LIBRARY_NAME "graph_nav_lib"
CACHE STRING "Name of compiled library")
IF(${CMAKE_BUILD_TYPE} MATCHES "Release")
MESSAGE(STATUS "Additional Flags for Release mode")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -DNDEBUG")
ELSEIF(${CMAKE_BUILD_TYPE} MATCHES "Debug")
MESSAGE(STATUS "Additional Flags for Debug mode")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
ENDIF()
INCLUDE($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
ROSBUILD_INIT()
SET(ROS_BUILD_STATIC_LIBS true)
SET(ROS_BUILD_SHARED_LIBS false)
LIST(APPEND CMAKE_PREFIX_PATH "/opt/libtorch")
FIND_PACKAGE(Torch REQUIRED)
FIND_PACKAGE(OpenCV REQUIRED)
IF(NOT ROS_BUILD_TYPE)
SET(ROS_BUILD_TYPE Release)
ENDIF()
MESSAGE(STATUS "ROS-Overrride Build Type: ${CMAKE_BUILD_TYPE}")
MESSAGE(STATUS "CXX Flags: ${CMAKE_CXX_FLAGS}")
MESSAGE(STATUS "LibTorch location: ${TORCH_INCLUDE_DIRS}")
MESSAGE(STATUS "LibTorch libraries: ${TORCH_LIBRARIES}")
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
SET(libs roslib roscpp rosbag glog gflags amrl_shared_lib boost_system lua5.1
pthread costmap_2d)
ADD_LIBRARY(shared_library
src/visualization/visualization.cc
src/vector_map/vector_map.cc)
ADD_SUBDIRECTORY(src/shared)
INCLUDE_DIRECTORIES(src/shared)
INCLUDE_DIRECTORIES(src/config_reader/include)
INCLUDE_DIRECTORIES(src/third_party)
INCLUDE_DIRECTORIES(src)
INCLUDE_DIRECTORIES(${OpenCV_INCLUDE_DIRS})
ROSBUILD_GENMSG()
ROSBUILD_GENSRV()
MESSAGE(STATUS "Includes: ${INCLUDE_DIRECTORIES}")
ROSBUILD_ADD_EXECUTABLE(navigation
src/navigation/navigation_main.cc
src/navigation/navigation.cc
src/navigation/motion_primitives.cc
src/navigation/ackermann_motion_primitives.cc
src/navigation/constant_curvature_arcs.cc
src/navigation/linear_evaluator.cc
src/navigation/image_tiler.cc
src/navigation/deep_cost_map_evaluator.cc
src/navigation/image_based_evaluator.cc
)
TARGET_LINK_LIBRARIES(navigation
shared_library ${libs} ${TORCH_LIBRARIES} ${OpenCV_LIBS})
ADD_EXECUTABLE(navigation_tests
src/navigation/navigation_tests.cc
src/navigation/motion_primitives.cc
)
TARGET_LINK_LIBRARIES(navigation_tests
gtest
gtest_main
${libs})
ROSBUILD_ADD_EXECUTABLE(social_nav
src/navigation/social_nav.cc
src/navigation/social_main.cc
src/navigation/motion_primitives.cc
src/navigation/ackermann_motion_primitives.cc
src/navigation/constant_curvature_arcs.cc
src/navigation/image_tiler.cc
src/navigation/linear_evaluator.cc
src/navigation/deep_cost_map_evaluator.cc
src/navigation/image_based_evaluator.cc
src/navigation/navigation.cc)
TARGET_LINK_LIBRARIES(social_nav shared_library ${libs} ${TORCH_LIBRARIES} ${OpenCV_LIBS})
add_dependencies(navigation ${catkin_EXPORTED_TARGETS})
add_dependencies(social_nav ${catkin_EXPORTED_TARGETS})