forked from ros-drivers/urg_node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
92 lines (79 loc) · 1.9 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
cmake_minimum_required(VERSION 3.5)
project(urg_node)
find_package(ament_cmake REQUIRED)
if(WIN32)
message(WARNING "${PROJECT_NAME} is currently not supported on Windows")
ament_package()
return()
endif()
# Default to C++17
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()
add_compile_options(-Wall)
# we currently still rely on boost for its `crc` component
find_package(Boost REQUIRED)
find_package(diagnostic_updater REQUIRED)
find_package(laser_proc REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_components REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(std_srvs REQUIRED)
find_package(urg_c REQUIRED)
find_package(urg_node_msgs REQUIRED)
add_library(urg_node SHARED
src/urg_c_wrapper.cpp
src/urg_node.cpp
)
target_include_directories(urg_node
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
ament_target_dependencies(urg_node
diagnostic_updater
laser_proc
rclcpp
rclcpp_components
sensor_msgs
std_srvs
urg_c
urg_node_msgs
Boost
)
rclcpp_components_register_node(urg_node
PLUGIN "urg_node::UrgNode"
EXECUTABLE urg_node_driver)
add_executable(getID src/get_id.cpp)
target_link_libraries(getID urg_node)
install(TARGETS urg_node getID
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION lib/${PROJECT_NAME}
)
install(DIRECTORY include/
DESTINATION include
)
install(PROGRAMS scripts/set_urg_ip.py
DESTINATION lib/${PROJECT_NAME}
)
install(DIRECTORY launch
DESTINATION share/${PROJECT_NAME}
)
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
set(ament_cmake_copyright_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()
ament_export_dependencies(urg_node_msgs)
ament_export_dependencies(
diagnostic_updater
laser_proc
rclcpp
sensor_msgs
std_srvs
urg_c
)
ament_export_include_directories(include)
ament_export_libraries(urg_node)
ament_package()