-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
117 lines (100 loc) · 3.06 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
cmake_minimum_required(VERSION 3.0.2)
project(centerpoint_detection_and_tracking)
set(arch ${CMAKE_HOST_SYSTEM_PROCESSOR})
find_package(CUDA REQUIRED)
find_package(catkin REQUIRED COMPONENTS
roscpp
roslib
pcl_ros
pcl_conversions
std_msgs
tf
)
if(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "aarch64")
set(CMAKE_C_COMPILER /usr/bin/aarch64-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER /usr/bin/aarch64-linux-gnu-g++)
set(CUDA_INSTALL_TARGET_DIR targets/aarch64-linux)
elseif(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "x86_64")
set(CMAKE_C_COMPILER /usr/bin/gcc)
set(CMAKE_CXX_COMPILER /usr/bin/g++)
set(CUDA_INSTALL_TARGET_DIR targets/x86_64-linux)
endif()
set(CUDA_TOOLKIT_ROOT_DIR /usr/local/cuda)
set(CUDA_INCLUDE_DIRS ${CUDA_TOOLKIT_ROOT_DIR}/${CUDA_INSTALL_TARGET_DIR}/include)
set(CMAKE_BUILD_TYPE "Release")
set(CMAKE_CXX_FLAGS_RELEASE "-Wno-deprecated-declarations -O2")
add_compile_options(-W)
add_compile_options(-std=c++14)
set(TENSORRT_INCLUDE_DIRS /shared_data/TensorRT-8.6.1.6/include)
set(TENSORRT_LIBRARY_DIRS /shared_data/TensorRT-8.6.1.6/lib)
include_directories(
${CUDA_INCLUDE_DIRS}
${TENSORRT_INCLUDE_DIRS}
3rdparty/libspconv/include
${catkin_INCLUDE_DIRS}
include
)
catkin_package(
CATKIN_DEPENDS roscpp roslib pcl_ros pcl_conversions tf
INCLUDE_DIRS include
LIBRARIES pointpillars
)
link_directories(
${TENSORRT_LIBRARY_DIRS}
3rdparty/libspconv/lib/${arch}
)
set(CenterPoint_files
src/centerpoint.cpp
src/postprocess.cpp
src/postprocess_kernels.cu
src/preprocess_kernels.cu
src/preprocess.cpp
src/tensorrt.cpp
)
cuda_add_library(centerpoint ${CenterPoint_files})
target_link_libraries(centerpoint
libnvinfer_plugin.so.8
libnvinfer.so
libnvonnxparser.so
libspconv.so
)
############################################################
# PCL
############################################################
add_definitions(${PCL_DEFINITIONS})
include_directories(${PCL_INCLUDE_DIRS})
link_directories(
${PCL_LIBRARY_DIRS}
)
#--------------------tracking lib----------------------
add_library(tracking_lib
src/tracking/hm_tracking_worker.cpp
src/tracking/distances/tracker_obsv_distance.cpp
src/tracking/filters/robust_kalman_filter.cpp
src/tracking/matchers/hungarian_tracker_obsv_matcher.cpp
src/tracking/trackers/multi_object_tracker.cpp
src/tracking/trackers/object_tracker.cpp
common/src/algos/hungarian_bigraph_matcher.cpp
)
target_link_libraries(tracking_lib
${catkin_LIBRARIES}
${PCL_LIBRARIES} )
#--------- centerpoint_detection_lib --------------
add_library(centerpoint_detection_lib
src/centerpoint_detection_and_tracking.cpp
)
target_link_libraries(centerpoint_detection_lib
centerpoint
tracking_lib
${catkin_LIBRARIES}
${PCL_LIBRARIES}
)
#--------- detection and tracking node executable -----------
add_executable(${PROJECT_NAME} main.cpp)
target_link_libraries(${PROJECT_NAME}
${catkin_LIBRARIES}
tracking_lib
centerpoint_detection_lib
${PCL_LIBRARIES}
${LINK_LIBRARY}
)