-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
142 lines (125 loc) · 3.73 KB
/
Copy pathCMakeLists.txt
File metadata and controls
142 lines (125 loc) · 3.73 KB
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
if("$ENV{ROS_VERSION}" STREQUAL "2")
cmake_minimum_required(VERSION 3.8)
set(DETECTED_ROS2 TRUE)
else()
cmake_minimum_required(VERSION 3.1)
set(DETECTED_ROS1 TRUE)
set (CMAKE_CXX_STANDARD 14)
endif()
project(mrpt_msgs)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
if(DETECTED_ROS1)
find_package(catkin REQUIRED COMPONENTS
geometry_msgs
message_generation
sensor_msgs
std_msgs
)
# list must be hand-ordered to satisfy dependencies between .msg files:
add_message_files(
DIRECTORY
msg-ros1
FILES
GraphSlamAgent.msg
GenericObservation.msg
GraphConstraint.msg
GraphSlamStats.msg
ObservationObject.msg
ObservationRangeBeacon.msg
ObservationRangeBearing.msg
WaypointSequence.msg
)
add_message_files(
DIRECTORY
msg-common
FILES
GenericObject.msg
GraphSlamAgents.msg
NetworkOfPoses.msg
NodeIDWithLaserScan.msg
NodeIDWithPose.msg
NodeIDWithPoseVec.msg
SingleObjectObservation.msg
SingleRangeBeaconObservation.msg
SingleRangeBearingObservation.msg
Waypoint.msg
)
add_service_files(
DIRECTORY srv
FILES
GetCMGraph.srv
)
generate_messages(DEPENDENCIES
geometry_msgs
sensor_msgs
std_msgs
)
catkin_package(CATKIN_DEPENDS
geometry_msgs
message_runtime
sensor_msgs
std_msgs
)
endif()
if(DETECTED_ROS2)
# find dependencies
find_package(ament_cmake REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(std_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(sensor_msgs REQUIRED)
rosidl_generate_interfaces(${PROJECT_NAME}
# Messages:
msg-ros2/GenericObservation.msg
msg-ros2/GraphConstraint.msg
msg-ros2/GraphSlamAgent.msg
msg-ros2/GraphSlamStats.msg
msg-ros2/ObservationObject.msg
msg-ros2/ObservationRangeBeacon.msg
msg-ros2/ObservationRangeBearing.msg
msg-ros2/WaypointSequence.msg
msg-common/GenericObject.msg
msg-common/GraphSlamAgents.msg
msg-common/NetworkOfPoses.msg
msg-common/NodeIDWithLaserScan.msg
msg-common/NodeIDWithPose.msg
msg-common/NodeIDWithPoseVec.msg
msg-common/SingleObjectObservation.msg
msg-common/SingleRangeBeaconObservation.msg
msg-common/SingleRangeBearingObservation.msg
msg-common/Waypoint.msg
# Services:
srv/GetCMGraph.srv
# deps:
DEPENDENCIES
std_msgs
geometry_msgs
sensor_msgs
ADD_LINTER_TESTS
)
rosidl_get_typesupport_target(cpp_typesupport_target "${PROJECT_NAME}" "rosidl_typesupport_cpp")
if(TARGET "${cpp_typesupport_target}")
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}")
#install(DIRECTORY include/ DESTINATION include/${PROJECT_NAME})
install(
TARGETS ${PROJECT_NAME}_library EXPORT export_${PROJECT_NAME}
)
# Export old-style CMake variables
ament_export_include_directories("include/${PROJECT_NAME}")
# Export modern CMake targets
ament_export_targets(export_${PROJECT_NAME})
endif()
if(BUILD_TESTING)
find_package(ament_cmake_xmllint REQUIRED)
ament_xmllint()
endif()
ament_export_dependencies(rosidl_default_runtime)
ament_package()
endif()