forked from fadlio/kinect_ros2
-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
68 lines (55 loc) · 1.67 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
cmake_minimum_required(VERSION 3.8)
project(kinect_ros2)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR})
include_directories(include)
# find dependencies
find_package(ament_cmake REQUIRED)
find_package(rclcpp_components REQUIRED)
find_package(ament_index_cpp REQUIRED)
find_package(rclcpp REQUIRED)
# find_package(Threads REQUIRED)
find_package(Freenect REQUIRED)
find_package(OpenCV REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(cv_bridge REQUIRED)
find_package(image_transport REQUIRED)
find_package(depth_image_proc REQUIRED)
find_package(camera_info_manager REQUIRED)
add_library(kinect_ros2_component SHARED src/kinect_ros2_component.cpp)
target_compile_definitions(kinect_ros2_component
PRIVATE "COMPOSITION_BUILDING_DLL")
ament_target_dependencies(kinect_ros2_component
rclcpp
sensor_msgs
std_msgs
cv_bridge
camera_info_manager
rclcpp_components
ament_index_cpp
image_transport
OpenCV)
target_link_libraries(kinect_ros2_component
${Freenect_LIBRARY})
rclcpp_components_register_nodes(kinect_ros2_component "kinect_ros2::KinectRosComponent")
add_executable(kinect_ros2_node
src/kinect_ros2_node.cpp)
target_link_libraries(kinect_ros2_node
kinect_ros2_component)
ament_target_dependencies(kinect_ros2_node
"rclcpp")
install(TARGETS
kinect_ros2_component
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin)
install(TARGETS
kinect_ros2_node
DESTINATION lib/${PROJECT_NAME})
install(
DIRECTORY cfg launch rviz
DESTINATION share/${PROJECT_NAME}
)
ament_package()