forked from tiiuae/fog_lib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
98 lines (78 loc) · 2.26 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
93
94
95
96
97
98
cmake_minimum_required(VERSION 3.12)
project(fog_lib)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
add_definitions("-Wall")
add_definitions("-Wextra")
add_definitions("-Wpedantic")
add_definitions("-g")
add_definitions("-O3")
if ("$ENV{ROS_DISTRO}" STREQUAL "foxy") # to select the correct version of declare_parameter() and avoid errors/warnings
add_definitions("-DROS_FOXY")
endif()
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_components REQUIRED)
find_package(rcl_interfaces REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(tf2 REQUIRED)
find_package(Threads REQUIRED)
include_directories(
include
${rclcpp_INCLUDE_DIRS}
)
## --------------------------------------------------------------
## | compile |
## --------------------------------------------------------------
add_library(misc SHARED
src/misc.cpp
)
add_library(scope_timer SHARED
src/scope_timer.cpp
)
add_library(median_filter SHARED
src/median_filter.cpp
)
add_library(cyclic SHARED
src/geometry/cyclic.cpp
)
add_library(geometry_misc SHARED
src/geometry/misc.cpp
)
## --------------------------------------------------------------
## | install |
## --------------------------------------------------------------
install(TARGETS
misc
scope_timer
median_filter
cyclic
geometry_misc
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
install(DIRECTORY include
DESTINATION .
)
ament_export_include_directories(include)
ament_export_libraries(
misc
scope_timer
median_filter
cyclic
geometry_misc
)
## --------------------------------------------------------------
## | testing |
## --------------------------------------------------------------
if(BUILD_TESTING)
# Include linting tests
# find_package(ament_lint_auto REQUIRED)
# ament_lint_auto_find_test_dependencies()
find_package(ament_cmake_gtest REQUIRED)
ament_add_gtest(geometry_test test/geometry/geometry_tests.cpp)
ament_add_gtest(median_filter_test test/median_filter/tests.cpp src/median_filter.cpp)
endif()
ament_package()