-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
95 lines (77 loc) · 2.65 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
cmake_minimum_required(VERSION 3.14)
project(cuda_pointcloud_preprocessor)
find_package(ament_cmake_auto REQUIRED)
find_package(CUDA)
find_package(PCL REQUIRED)
if(NOT ${CUDA_FOUND})
message(WARNING "cuda was not found, so the cuda_pointcloud_preprocessor package will not be built.")
return()
endif()
ament_auto_find_build_dependencies()
# Default to C++17
if (NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif ()
if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic -Wunused-function)
endif ()
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()
include_directories(
include
SYSTEM
${CUDA_INCLUDE_DIRS}
${nebula_common_INCLUDE_DIRS}
)
list(APPEND CUDA_NVCC_FLAGS "--expt-relaxed-constexpr -diag-suppress 20012")
cuda_add_library(cuda_pointcloud_preprocessor_lib SHARED
src/cuda_pointcloud_preprocessor/cuda_pointcloud_preprocessor.cu
#src/cuda_pointcloud_preprocessor/cuda_concatenate_and_time_sync.cu
)
target_link_libraries(cuda_pointcloud_preprocessor_lib
${PCL_LIBRARIES}
)
target_include_directories(cuda_pointcloud_preprocessor_lib SYSTEM PRIVATE
${autoware_point_types_INCLUDE_DIRS}
${cuda_blackboard_INCLUDE_DIRS}
${geometry_msgs_INCLUDE_DIRS}
${nebula_common_INCLUDE_DIRS}
${rclcpp_INCLUDE_DIRS}
${rcl_interfaces_INCLUDE_DIRS}
${sensor_msgs_INCLUDE_DIRS}
${tf2_INCLUDE_DIRS}
)
# Targets
ament_auto_add_library(cuda_pointcloud_preprocessor SHARED
src/cuda_pointcloud_preprocessor/cuda_pointcloud_preprocessor_node.cpp
#src/cuda_pointcloud_preprocessor/cuda_concatenate_and_time_sync_node.cpp
)
target_link_libraries(cuda_pointcloud_preprocessor
${CUDA_LIBRARIES}
cuda_pointcloud_preprocessor_lib
)
rclcpp_components_register_node(cuda_pointcloud_preprocessor
PLUGIN "autoware::cuda_pointcloud_preprocessor::CudaPointcloudPreprocessorNode"
EXECUTABLE cuda_pointcloud_preprocessor_node
)
#rclcpp_components_register_node(cuda_pointcloud_preprocessor
# PLUGIN "cuda_pointcloud_preprocessor::CudaPointCloudConcatenateAndSyncNode"
# EXECUTABLE cuda_pointcloud_concatenate_and_sync_node
#)
install(DIRECTORY launch config
DESTINATION share/${PROJECT_NAME}
)
ament_auto_package()
# Set ROS_DISTRO macros
set(ROS_DISTRO $ENV{ROS_DISTRO})
if(${ROS_DISTRO} STREQUAL "rolling")
add_compile_definitions(ROS_DISTRO_ROLLING)
elseif(${ROS_DISTRO} STREQUAL "foxy")
add_compile_definitions(ROS_DISTRO_FOXY)
elseif(${ROS_DISTRO} STREQUAL "galactic")
add_compile_definitions(ROS_DISTRO_GALACTIC)
elseif(${ROS_DISTRO} STREQUAL "humble")
add_compile_definitions(ROS_DISTRO_HUMBLE)
endif()