-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathCMakeLists.txt
87 lines (73 loc) · 2.21 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
cmake_minimum_required(VERSION 3.8)
project(tdt_vision)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 20)
# openvino tensort用,编译动态库时,符号表对只读文件重映射,需要添加此指令
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# 包含头文件
include_directories(
"detect/include"
"resolve/include"
"calibrate/include"
"radar_utils"
"yolo"
)
option(CUDA_USE_STATIC_CUDA_RUNTIME OFF)
set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_CUDA_COMPILER /usr/local/cuda/bin/nvcc)
include_directories(/usr/local/cuda/include)
link_directories(/usr/local/cuda/lib64)
find_package(ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies()
file(GLOB_RECURSE RADAR_UTILS_SRCS "radar_utils/*.cpp")
ament_auto_add_library(radar_utils SHARED
${RADAR_UTILS_SRCS}
)
set(RADAR_DETECT "radar_detect")
file(GLOB_RECURSE RADAR_DETECT_SRCS "detect/src/*.cpp")
ament_auto_add_library(${RADAR_DETECT} SHARED
${RADAR_DETECT_SRCS}
)
find_package(CUDA)
include(${PROJECT_SOURCE_DIR}/cmake/modules/libnvinferConfig.cmake)
message("Using Cuda Version: ${CUDA_VERSION} and TensorRT Version: ${nvinfer_VERSION}")
add_definitions(-D use_tensorrt)
enable_language(CUDA)
include_directories(${CUDA_INCLUDE_DIRS})
include_directories(${nvinfer_INCLUDE_DIRS})
add_subdirectory(yolo)
include_directories(${PROJECT_SOURCE_DIR}/yolo)
target_link_libraries(${RADAR_DETECT}
yolo
${nvinfer_LIBRARY}
cudart
nvonnxparser
fmt
${PCL_LIBRARIES}
)
rclcpp_components_register_node(${RADAR_DETECT}
PLUGIN "tdt_radar::Detect"
EXECUTABLE ${RADAR_DETECT}_node
)
set(RADAR_RESOLVE "radar_resolve")
file(GLOB_RECURSE RADAR_RESOLVE_SRCS "resolve/src/*.cpp")
ament_auto_add_library(${RADAR_RESOLVE} SHARED
${RADAR_RESOLVE_SRCS}
)
rclcpp_components_register_node(${RADAR_RESOLVE}
PLUGIN "tdt_radar::Resolve"
EXECUTABLE ${RADAR_RESOLVE}_node
)
set(RADAR_CALIBRATE "radar_calibrate")
file(GLOB_RECURSE RADAR_CALIBRATE_SRCS "calibrate/src/*.cpp")
ament_auto_add_library(${RADAR_CALIBRATE} SHARED
${RADAR_CALIBRATE_SRCS}
)
rclcpp_components_register_node(${RADAR_CALIBRATE}
PLUGIN "tdt_radar::Calibrate"
EXECUTABLE ${RADAR_CALIBRATE}_node
)
ament_auto_package(
INSTALL_TO_SHARE
launch
)