-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
91 lines (71 loc) · 2.15 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
cmake_minimum_required(VERSION 3.14)
project(cuda_blackboard)
find_package(ament_cmake_auto REQUIRED)
find_package(CUDA)
if(NOT ${CUDA_FOUND})
message(WARNING "cuda was not found. the cuda_blackboard 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}
)
ament_auto_add_library(cuda_blackboard SHARED
src/cuda_blackboard.cpp
src/cuda_image.cpp
src/cuda_pointcloud2.cpp
src/cuda_blackboard_publisher.cpp
src/cuda_blackboard_subscriber.cpp
)
target_link_libraries(cuda_blackboard
${CUDA_LIBRARIES}
)
####
ament_auto_add_library(cuda_blackboard_publisher_example SHARED
src/cuda_blackboard_publisher_node.cpp
)
target_link_libraries(cuda_blackboard_publisher_example
cuda_blackboard
)
rclcpp_components_register_node(cuda_blackboard_publisher_example
PLUGIN "cuda_blackboard::CudaBlackboardPublisherNode"
EXECUTABLE cuda_blackboard_publisher_node
)
ament_auto_add_library(cuda_blackboard_subscriber_example SHARED
src/cuda_blackboard_subscriber_node.cpp
)
target_link_libraries(cuda_blackboard_subscriber_example
cuda_blackboard
)
rclcpp_components_register_node(cuda_blackboard_subscriber_example
PLUGIN "cuda_blackboard::CudaBlackboardSubscriberNode"
EXECUTABLE cuda_blackboard_subscriber_node
)
install(DIRECTORY launch
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()