This repository has been archived by the owner on Jul 19, 2024. It is now read-only.
forked from PickNikRobotics/RSL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
70 lines (60 loc) · 1.72 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
cmake_minimum_required(VERSION 3.22)
project(rsl VERSION 0.2.1 LANGUAGES CXX DESCRIPTION "ROS Support Library")
set(CMAKE_CXX_EXTENSIONS OFF)
find_package(ament_cmake REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(fmt REQUIRED)
find_package(rclcpp REQUIRED)
find_package(tcb_span REQUIRED)
find_package(tl_expected REQUIRED)
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
add_compile_options(-Werror -Wall -Wextra -Wpedantic -Wshadow -Wconversion -Wsign-conversion -Wold-style-cast)
else()
add_definitions(-D_USE_MATH_DEFINES)
endif()
# Default to shared libraries to work around the Debian ecosystem's inability to specify -DBUILD_SHARED_LIBS=ON at configuration :(
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
add_library(rsl
src/parameter_validators.cpp
src/random.cpp
)
set_target_properties(rsl PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
add_library(rsl::rsl ALIAS rsl)
target_compile_features(rsl PUBLIC cxx_std_17)
target_include_directories(rsl PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include/rsl>
)
target_link_libraries(rsl PUBLIC
Eigen3::Eigen
fmt::fmt
rclcpp::rclcpp
tcb_span::tcb_span
tl_expected::tl_expected
)
# add_subdirectory(docs)
if(BUILD_TESTING)
add_subdirectory(tests)
endif()
install(
DIRECTORY include/
DESTINATION include/rsl
)
install(
TARGETS rsl
EXPORT export_rsl
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
)
ament_export_targets(export_rsl HAS_LIBRARY_TARGET)
ament_export_dependencies(
Eigen3
fmt
rclcpp
tcb_span
tl_expected
)
ament_package()
add_custom_target(tidy COMMAND run-clang-tidy -p ${CMAKE_BINARY_DIR})