-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
90 lines (75 loc) · 2.46 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
cmake_minimum_required(VERSION 3.5)
project(quickplot)
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wunused)
endif()
# TODO shouldn't need to repeat it, imgui_vendor should export setting
set(OpenGL_GL_PREFERENCE GLVND)
find_package(Boost REQUIRED COMPONENTS system)
find_package(ament_cmake REQUIRED)
find_package(implot_vendor REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rcpputils REQUIRED)
find_package(yaml_cpp_vendor REQUIRED)
find_package(std_msgs REQUIRED)
find_package(rosidl_typesupport_cpp REQUIRED)
find_package(rosidl_typesupport_introspection_cpp REQUIRED)
add_library(quickplot
src/introspection.cpp
src/message_parser.cpp
src/config.cpp)
target_include_directories(quickplot PUBLIC include)
ament_target_dependencies(quickplot
rclcpp
rcpputils
yaml_cpp_vendor
std_msgs
rosidl_typesupport_cpp
rosidl_typesupport_introspection_cpp)
add_executable(quickplot_bin src/main.cpp)
set_target_properties(quickplot_bin PROPERTIES OUTPUT_NAME "quickplot")
target_link_libraries(quickplot_bin
Boost::system
quickplot)
ament_target_dependencies(quickplot_bin
implot_vendor
rclcpp
std_msgs
rosidl_typesupport_cpp
rosidl_typesupport_introspection_cpp)
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
find_package(ament_cmake_gmock REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(vision_msgs REQUIRED)
ament_add_gmock(test_introspection test/test_introspection.cpp)
target_link_libraries(test_introspection quickplot)
ament_target_dependencies(test_introspection
rclcpp
rosidl_typesupport_introspection_cpp)
ament_add_gmock(test_message_parser test/test_message_parser.cpp)
target_link_libraries(test_message_parser quickplot)
ament_target_dependencies(test_message_parser
rclcpp
rosidl_typesupport_cpp
rosidl_typesupport_introspection_cpp
geometry_msgs
vision_msgs)
ament_add_gmock(test_config test/test_config.cpp WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
target_link_libraries(test_config quickplot)
ament_add_gmock(test_plot test/test_plot.cpp)
target_link_libraries(test_plot quickplot)
ament_target_dependencies(test_plot
implot_vendor
rclcpp)
endif()
install(TARGETS quickplot quickplot_bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION lib/${PROJECT_NAME}
)
ament_package()