forked from MrCerealKiller/ros_y3space_driver
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
89 lines (71 loc) · 1.88 KB
/
CMakeLists.txt
File metadata and controls
89 lines (71 loc) · 1.88 KB
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
cmake_minimum_required(VERSION 3.5)
project(y3space_driver)
set(CMAKE_BUILD_TYPE Debug)
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
#add_compile_options(-Wno-dev)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
#comment the add_compile_options to deactivate the warnings as errors
#add_compile_options(-Wall -Wextra -Wpedantic)
endif()
set(dependencies
rclcpp
std_msgs
std_srvs
sensor_msgs
geometry_msgs
rosbag2_storage
rosbag2_cpp
am_utils
serial
tf2
tf2_geometry_msgs
tf2_ros
)
foreach(Dependency IN ITEMS ${dependencies})
find_package(${Dependency} REQUIRED)
endforeach()
###########
## Build ##
###########
include_directories(
include
)
add_executable(y3space_driver
src/y3space_driver/SerialInterface.cpp
src/y3space_driver/Y3SpaceDriver.cpp
src/y3space_driver/yost_main.cpp
src/y3space_driver/yost_node.cpp)
ament_target_dependencies(y3space_driver ${dependencies})
#############
## Install ##
#############
install(DIRECTORY include/
DESTINATION include/
)
install(DIRECTORY
launch
DESTINATION share/${PROJECT_NAME}/
)
install(TARGETS
y3space_driver
DESTINATION lib/${PROJECT_NAME})
#############
## Test ##
#############
if(BUILD_TESTING)
find_package(ament_cmake_gtest REQUIRED)
ament_add_gtest(${PROJECT_NAME}_test test/test.cpp)
target_include_directories(${PROJECT_NAME}_test PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
ament_target_dependencies(${PROJECT_NAME}_test
${dependencies}
)
#target_link_libraries(${PROJECT_NAME}test name_of_local_library)
endif()
ament_export_include_directories(include)
ament_export_dependencies(${dependencies})
ament_package()