From f6866c5fc13c725d207e1c6edb1c651e18fe6ae0 Mon Sep 17 00:00:00 2001 From: Michel Hidalgo Date: Fri, 10 Apr 2020 13:19:15 -0300 Subject: [PATCH] Register RMW output filters. Signed-off-by: Michel Hidalgo --- rmw_cyclonedds_cpp/CMakeLists.txt | 4 +++ .../get_rmw_cyclonedds_output_filter.cmake | 31 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 rmw_cyclonedds_cpp/cmake/get_rmw_cyclonedds_output_filter.cmake diff --git a/rmw_cyclonedds_cpp/CMakeLists.txt b/rmw_cyclonedds_cpp/CMakeLists.txt index 8da01c4..f61560c 100644 --- a/rmw_cyclonedds_cpp/CMakeLists.txt +++ b/rmw_cyclonedds_cpp/CMakeLists.txt @@ -113,3 +113,7 @@ install( LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) + +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}") diff --git a/rmw_cyclonedds_cpp/cmake/get_rmw_cyclonedds_output_filter.cmake b/rmw_cyclonedds_cpp/cmake/get_rmw_cyclonedds_output_filter.cmake new file mode 100644 index 0000000..0f28adc --- /dev/null +++ b/rmw_cyclonedds_cpp/cmake/get_rmw_cyclonedds_output_filter.cmake @@ -0,0 +1,31 @@ +# Copyright 2020 Open Source Robotics Foundation, Inc. +# +# 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. + +# +# Get patterns for output filtering for CycloneDDS RMW. +# +# :param output_patterns: patterns that will be used to identify console +# output generated by CycloneDDS. +# :type output_filter: string +# +# @public +# +macro(get_rmw_cyclonedds_output_filter output_patterns) + if(NOT "${ARGN}" STREQUAL "") + message(FATAL_ERROR "get_rmw_cyclonedds_output_filter() called with " + "unused arguments: ${ARGN}") + endif() + + set(${output_patterns} ".*using network interface \\w+ \\(.*\\) selected arbitrarily from:.*") +endmacro()