-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
executable file
·72 lines (60 loc) · 2.09 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
cmake_minimum_required(VERSION 3.5)
project(micro_ros_renesas_testbench)
if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 11)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
option(UBUILD_TEST_BENCHMARK "Build benchmark tests cases." ON)
#################################################
# package dependencies
#################################################
find_package(ament_cmake REQUIRED)
#################################################
# testing
#################################################
if(BUILD_TESTING)
# find_package(ament_lint_auto REQUIRED)
find_package(ament_cmake_gtest REQUIRED)
set(ament_cmake_copyright_FOUND TRUE) # No copyright header check since link to NOTICE file is not recognized properly.
find_package(fastcdr REQUIRED)
find_package(fastrtps REQUIRED)
find_package(fastrtps_cmake_module REQUIRED)
find_package(microxrcedds_agent REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_action REQUIRED)
find_package(rmw REQUIRED)
find_package(std_msgs REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(tf2_msgs REQUIRED)
find_package(example_interfaces REQUIRED)
# ament_lint_auto_find_test_dependencies()
ament_add_gtest(${PROJECT_NAME}_test
test/micro_ros_renesas_testbench/boards.cpp
test/micro_ros_renesas_testbench/test.cpp
test/micro_ros_renesas_testbench/test_agent.cpp
test/micro_ros_renesas_testbench/test_regressions.cpp
$<$<BOOL:${UBUILD_TEST_BENCHMARK}>:test/micro_ros_renesas_testbench/test_benchmark.cpp>
)
string(TOUPPER $ENV{ROS_DISTRO} ROS_DISTRO)
target_compile_options(${PROJECT_NAME}_test PRIVATE -DROS_DISTRO_${ROS_DISTRO})
target_include_directories(${PROJECT_NAME}_test PRIVATE include src test)
target_link_libraries(${PROJECT_NAME}_test
fastcdr
fastrtps
microxrcedds_agent)
ament_target_dependencies(${PROJECT_NAME}_test
fastcdr
fastrtps
microxrcedds_agent
rclcpp
rclcpp_action
rmw
std_msgs
sensor_msgs
tf2_msgs
example_interfaces
)
endif()
ament_package()