-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
93 lines (72 loc) · 3.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
91
92
cmake_minimum_required(VERSION 3.8)
project(force_dimension)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# *****************************************************************************
# Find standard dependencies.
# *****************************************************************************
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(example_interfaces REQUIRED)
# *****************************************************************************
# Find the Force Dimension SDK dependency.
# *****************************************************************************
# Ensure that the Force Dimension SDK can be found, if the environmental
# variable is set.
if(DEFINED ENV{ForceDimensionSDK_DIR})
set(ForceDimensionSDK_DIR $ENV{ForceDimensionSDK_DIR})
endif()
# Find the SDK.
find_package(ForceDimensionSDK REQUIRED)
# If the import of the Force Dimension SDK failed, then issue a message.
if(NOT ForceDimensionSDK_FOUND)
message(ERROR "Set Force Dimension SDK base path via the environmental variable ForceDimensionSDK_DIR, or via the argument: cmake -D ForceDimensionSDK_DIR=/path/to/sdk.")
endif()
# *****************************************************************************
# Add the Force Dimension node dependency.
# *****************************************************************************
add_executable(node src/entry_point.cpp src/node.cpp
src/log.cpp src/publish.cpp src/subscribe.cpp
src/parameters.cpp src/gravity_compensation.cpp
src/forces.cpp)
ament_target_dependencies(node rclcpp geometry_msgs
example_interfaces ForceDimensionSDK)
# *****************************************************************************
# Install.
# *****************************************************************************
install(TARGETS
node
DESTINATION lib/${PROJECT_NAME})
# *****************************************************************************
# Install launch files.
# *****************************************************************************
install(DIRECTORY
launch
DESTINATION share/${PROJECT_NAME}/
)
# *****************************************************************************
# Add the Python module dependencies
# *****************************************************************************
find_package(ament_cmake_python REQUIRED)
find_package(rclpy REQUIRED)
# *****************************************************************************
# Install the Python package.
# *****************************************************************************
ament_python_install_package(${PROJECT_NAME})
# *****************************************************************************
# Install the Python scripts.
# *****************************************************************************
install(PROGRAMS scripts/run_example DESTINATION lib/${PROJECT_NAME})
# *****************************************************************************
# Testing.
# *****************************************************************************
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()
# *****************************************************************************
# Finish.
# *****************************************************************************
ament_package()