-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
107 lines (90 loc) · 2.34 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
cmake_minimum_required(VERSION 3.8)
project(orbbec_camera_splitter)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# find dependencies
set(CMAKE_CXX_STANDARD 17)
add_compile_options(-Wall -Wextra -Wpedantic)
set(CMAKE_CXX_STANDARD 17)
add_compile_options(-Wall -Wextra -Wpedantic)
# find dependencies
find_package(ament_cmake REQUIRED)
find_package(ament_cmake_ros REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_components REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(message_filters REQUIRED)
find_package(orbbec_camera_msgs REQUIRED)
find_package(nvblox_ros_common REQUIRED)
find_package(isaac_ros_common REQUIRED)
find_package(CUDAToolkit REQUIRED)
#############
# LIBRARIES #
#############
add_library(${PROJECT_NAME}_component
src/${PROJECT_NAME}_node.cpp
)
target_compile_definitions(${PROJECT_NAME}_component
PRIVATE "COMPOSITION_BUILDING_DLL")
ament_target_dependencies(${PROJECT_NAME}_component
rclcpp
rclcpp_components
sensor_msgs
message_filters
orbbec_camera_msgs
nvblox_ros_common
isaac_ros_common
)
target_include_directories(${PROJECT_NAME}_component PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
rclcpp_components_register_nodes(${PROJECT_NAME}_component "nvblox::OrbbecCameraSplitterNode")
set(node_plugins "${node_plugins}nvblox::OrbbecCameraSplitterNode;$<TARGET_FILE:${PROJECT_NAME}_component>\n")
############
# BINARIES #
############
add_executable(${PROJECT_NAME}_node
src/${PROJECT_NAME}_node_main.cpp
)
target_link_libraries(${PROJECT_NAME}_node ${PROJECT_NAME}_component)
###########
# INSTALL #
###########
# includes
install(
DIRECTORY include/
DESTINATION include
)
# libs
install(
TARGETS ${PROJECT_NAME}_component
EXPORT ${PROJECT_NAME}Targets
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
# nodes
install(TARGETS ${PROJECT_NAME}_node
DESTINATION lib/${PROJECT_NAME})
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()
##########
# EXPORT #
##########
ament_export_include_directories(
include
)
ament_export_libraries(
${PROJECT_NAME}_component
)
ament_export_targets(
${PROJECT_NAME}Targets
)
ament_export_dependencies(
rclcpp
sensor_msgs
)
ament_package()