/
CMakeLists.txt
157 lines (137 loc) · 4.34 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
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# Copyright 2016-2018 Proyectos y Sistemas de Mantenimiento SL (eProsima).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
cmake_minimum_required(VERSION 3.5)
project(rmw_fastrtps_shared_cpp)
# 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(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wthread-safety)
endif()
if(SECURITY)
find_package(OpenSSL REQUIRED)
endif()
find_package(ament_cmake_ros REQUIRED)
find_package(rcpputils REQUIRED)
find_package(rcutils REQUIRED)
find_package(rmw_dds_common REQUIRED)
find_package(rosidl_typesupport_introspection_c REQUIRED)
find_package(rosidl_typesupport_introspection_cpp REQUIRED)
find_package(tracetools REQUIRED)
find_package(fastrtps_cmake_module REQUIRED)
find_package(fastcdr REQUIRED CONFIG)
find_package(fastrtps 2.3 REQUIRED CONFIG)
find_package(FastRTPS 2.3 REQUIRED MODULE)
find_package(rmw REQUIRED)
add_library(rmw_fastrtps_shared_cpp
src/custom_publisher_info.cpp
src/custom_subscriber_info.cpp
src/create_rmw_gid.cpp
src/demangle.cpp
src/init_rmw_context_impl.cpp
src/listener_thread.cpp
src/namespace_prefix.cpp
src/participant.cpp
src/publisher.cpp
src/qos.cpp
src/rmw_client.cpp
src/rmw_compare_gids_equal.cpp
src/rmw_count.cpp
src/rmw_event.cpp
src/rmw_features.cpp
src/rmw_get_endpoint_network_flow.cpp
src/rmw_get_gid_for_publisher.cpp
src/rmw_get_topic_endpoint_info.cpp
src/rmw_guard_condition.cpp
src/rmw_init.cpp
src/rmw_logging.cpp
src/rmw_node.cpp
src/rmw_node_info_and_types.cpp
src/rmw_node_names.cpp
src/rmw_publish.cpp
src/rmw_publisher.cpp
src/rmw_qos.cpp
src/rmw_request.cpp
src/rmw_response.cpp
src/rmw_security_logging.cpp
src/rmw_service.cpp
src/rmw_service_names_and_types.cpp
src/rmw_service_server_is_available.cpp
src/rmw_subscription.cpp
src/rmw_take.cpp
src/rmw_topic_names_and_types.cpp
src/rmw_trigger_guard_condition.cpp
src/rmw_wait.cpp
src/rmw_wait_set.cpp
src/subscription.cpp
src/time_utils.cpp
src/TypeSupport_impl.cpp
src/utils.cpp
)
target_include_directories(rmw_fastrtps_shared_cpp
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>")
target_link_libraries(rmw_fastrtps_shared_cpp
fastcdr fastrtps
)
# specific order: dependents before dependencies
ament_target_dependencies(rmw_fastrtps_shared_cpp
"rcpputils"
"rcutils"
"rmw"
"rmw_dds_common"
"rosidl_typesupport_introspection_c"
"rosidl_typesupport_introspection_cpp"
"tracetools"
)
# Causes the visibility macros to use dllexport rather than dllimport,
# which is appropriate when building the dll but not consuming it.
target_compile_definitions(${PROJECT_NAME}
PRIVATE "RMW_FASTRTPS_SHARED_CPP_BUILDING_LIBRARY")
# Export old-style CMake variables
ament_export_include_directories("include/${PROJECT_NAME}")
ament_export_libraries(rmw_fastrtps_shared_cpp)
# Export modern CMake targets
ament_export_targets(rmw_fastrtps_shared_cpp)
# specific order: dependents before dependencies
ament_export_dependencies(rcpputils)
ament_export_dependencies(rcutils)
ament_export_dependencies(rmw)
ament_export_dependencies(rmw_dds_common)
ament_export_dependencies(rosidl_typesupport_introspection_c)
ament_export_dependencies(rosidl_typesupport_introspection_cpp)
ament_export_dependencies(tracetools)
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
add_subdirectory(test)
endif()
ament_package(
CONFIG_EXTRAS_POST "rmw_fastrtps_shared_cpp-extras.cmake"
)
install(
DIRECTORY include/
DESTINATION include/${PROJECT_NAME}
)
install(
TARGETS rmw_fastrtps_shared_cpp EXPORT rmw_fastrtps_shared_cpp
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)