2018-07-09 13:22:25 +02:00
|
|
|
# Copyright 2018 ADLINK Technology Limited.
|
|
|
|
#
|
|
|
|
# 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_cyclonedds_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")
|
2020-04-13 21:05:42 -05:00
|
|
|
add_compile_options(-Wall -Wextra -Wpedantic -Wimplicit-fallthrough)
|
2018-07-09 13:22:25 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
find_package(ament_cmake_ros REQUIRED)
|
|
|
|
|
|
|
|
find_package(rcutils REQUIRED)
|
2020-04-22 19:01:05 +02:00
|
|
|
find_package(rcpputils REQUIRED)
|
2018-07-09 13:22:25 +02:00
|
|
|
|
2020-04-09 11:45:50 -05:00
|
|
|
#find_package(cyclonedds_cmake_module REQUIRED)
|
2019-10-25 08:45:39 -07:00
|
|
|
find_package(CycloneDDS QUIET CONFIG)
|
|
|
|
if(NOT CycloneDDS_FOUND)
|
|
|
|
message(WARNING "Could not find Eclipse Cyclone DDS - skipping '${PROJECT_NAME}'")
|
|
|
|
ament_package()
|
|
|
|
return()
|
|
|
|
endif()
|
2018-07-09 13:22:25 +02:00
|
|
|
|
|
|
|
find_package(rmw REQUIRED)
|
2020-04-22 19:01:05 +02:00
|
|
|
find_package(rmw_dds_common REQUIRED)
|
2020-04-10 12:26:45 +02:00
|
|
|
find_package(rosidl_runtime_c REQUIRED)
|
2018-07-09 13:22:25 +02:00
|
|
|
find_package(rosidl_typesupport_introspection_c REQUIRED)
|
|
|
|
find_package(rosidl_typesupport_introspection_cpp REQUIRED)
|
|
|
|
|
|
|
|
ament_export_dependencies(rcutils)
|
2020-04-22 19:01:05 +02:00
|
|
|
ament_export_dependencies(rcpputils)
|
2018-07-09 13:22:25 +02:00
|
|
|
ament_export_dependencies(rmw)
|
2020-04-10 12:26:45 +02:00
|
|
|
ament_export_dependencies(rosidl_runtime_c)
|
2020-04-22 19:01:05 +02:00
|
|
|
ament_export_dependencies(rmw_dds_common)
|
2018-07-09 13:22:25 +02:00
|
|
|
ament_export_dependencies(rosidl_typesupport_introspection_c)
|
|
|
|
ament_export_dependencies(rosidl_typesupport_introspection_cpp)
|
|
|
|
|
|
|
|
add_library(rmw_cyclonedds_cpp
|
|
|
|
src/rmw_node.cpp
|
2019-04-29 09:33:13 +02:00
|
|
|
src/serdata.cpp
|
2018-07-19 16:37:12 +02:00
|
|
|
src/serdes.cpp
|
2019-08-19 11:09:01 +02:00
|
|
|
src/u16string.cpp
|
2019-09-19 11:56:26 +02:00
|
|
|
src/exception.cpp
|
2020-04-22 19:01:05 +02:00
|
|
|
src/demangle.cpp
|
2019-09-19 11:56:26 +02:00
|
|
|
src/deserialization_exception.cpp
|
2019-12-05 14:42:11 -06:00
|
|
|
src/Serialization.cpp
|
|
|
|
src/TypeSupport2.cpp)
|
2018-07-09 13:22:25 +02:00
|
|
|
|
2019-11-18 02:56:47 -06:00
|
|
|
target_include_directories(rmw_cyclonedds_cpp PUBLIC
|
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
|
|
|
$<INSTALL_INTERFACE:include>
|
|
|
|
)
|
|
|
|
|
2020-04-22 19:01:05 +02:00
|
|
|
target_link_libraries(rmw_cyclonedds_cpp
|
|
|
|
CycloneDDS::ddsc
|
|
|
|
)
|
2018-07-09 13:22:25 +02:00
|
|
|
|
|
|
|
ament_target_dependencies(rmw_cyclonedds_cpp
|
|
|
|
"rcutils"
|
2020-04-22 19:01:05 +02:00
|
|
|
"rcpputils"
|
2018-07-09 13:22:25 +02:00
|
|
|
"rosidl_typesupport_introspection_c"
|
|
|
|
"rosidl_typesupport_introspection_cpp"
|
|
|
|
"rmw"
|
2020-04-22 19:01:05 +02:00
|
|
|
"rmw_dds_common"
|
2020-04-10 12:26:45 +02:00
|
|
|
"rosidl_runtime_c"
|
2018-07-09 13:22:25 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
configure_rmw_library(rmw_cyclonedds_cpp)
|
|
|
|
|
2019-10-17 22:24:44 -05:00
|
|
|
target_compile_definitions(${PROJECT_NAME}
|
|
|
|
PRIVATE
|
|
|
|
RMW_VERSION_MAJOR=${rmw_VERSION_MAJOR}
|
|
|
|
RMW_VERSION_MINOR=${rmw_VERSION_MINOR}
|
|
|
|
RMW_VERSION_PATCH=${rmw_VERSION_PATCH}
|
|
|
|
)
|
|
|
|
|
2018-07-09 13:22:25 +02:00
|
|
|
# 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}
|
2019-04-29 09:33:13 +02:00
|
|
|
PRIVATE "RMW_CYCLONEDDS_CPP_BUILDING_LIBRARY")
|
2018-07-09 13:22:25 +02:00
|
|
|
|
|
|
|
ament_export_include_directories(include)
|
|
|
|
ament_export_libraries(rmw_cyclonedds_cpp)
|
|
|
|
|
|
|
|
register_rmw_implementation(
|
|
|
|
"c:rosidl_typesupport_c:rosidl_typesupport_introspection_c"
|
|
|
|
"cpp:rosidl_typesupport_cpp:rosidl_typesupport_introspection_cpp")
|
|
|
|
|
|
|
|
if(BUILD_TESTING)
|
|
|
|
find_package(ament_lint_auto REQUIRED)
|
|
|
|
ament_lint_auto_find_test_dependencies()
|
|
|
|
endif()
|
|
|
|
|
2020-02-10 09:08:23 -06:00
|
|
|
ament_package()
|
2018-07-09 13:22:25 +02:00
|
|
|
|
|
|
|
install(
|
|
|
|
DIRECTORY include/
|
|
|
|
DESTINATION include
|
|
|
|
)
|
|
|
|
|
|
|
|
install(
|
|
|
|
TARGETS rmw_cyclonedds_cpp
|
|
|
|
ARCHIVE DESTINATION lib
|
|
|
|
LIBRARY DESTINATION lib
|
|
|
|
RUNTIME DESTINATION bin
|
|
|
|
)
|
2020-04-10 13:19:15 -03:00
|
|
|
|
|
|
|
include(cmake/get_rmw_cyclonedds_output_filter.cmake)
|
|
|
|
get_rmw_cyclonedds_output_filter(rmw_cyclonedds_output_patterns)
|
|
|
|
ament_index_register_resource("rmw_output_patterns" CONTENT "${rmw_cyclonedds_output_patterns}")
|