-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCMakeLists.txt
59 lines (49 loc) · 1.57 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
cmake_minimum_required(VERSION 3.22)
project(lbr_fri_idl)
# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
endif()
# find dependencies
find_package(ament_cmake REQUIRED)
find_package(builtin_interfaces REQUIRED)
find_package(rosidl_default_generators REQUIRED)
rosidl_generate_interfaces(lbr_fri_idl
msg/LBRCommand.msg
msg/LBRJointPositionCommand.msg
msg/LBRState.msg
msg/LBRTorqueCommand.msg
msg/LBRWrenchCommand.msg
DEPENDENCIES builtin_interfaces
ADD_LINTER_TESTS
)
ament_export_dependencies(rosidl_default_runtime)
if (BUILD_TESTING)
find_package(ament_cmake_gtest REQUIRED)
find_package(FRIClient REQUIRED)
# link against messages from same package
rosidl_get_typesupport_target(cpp_typesupport_target ${PROJECT_NAME} rosidl_typesupport_cpp)
add_library(${PROJECT_NAME}_library INTERFACE)
target_include_directories(${PROJECT_NAME}_library INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include/${PROJECT_NAME}>
)
target_link_libraries(${PROJECT_NAME}_library INTERFACE
${cpp_typesupport_target}
)
# test commands
ament_add_gtest(${PROJECT_NAME}_test_command_interfaces
test/test_command_interfaces.cpp
)
target_link_libraries(${PROJECT_NAME}_test_command_interfaces
${PROJECT_NAME}_library
FRIClient::FRIClient
)
endif()
ament_package()