moving rmw_implementation to the rmw repo

This commit is contained in:
William Woodall 2015-03-05 13:01:53 -08:00
parent 25c8c567b4
commit 61b78366bc
5 changed files with 0 additions and 93 deletions

View file

@ -1,14 +0,0 @@
cmake_minimum_required(VERSION 2.8.3)
project(rmw_implementation NONE)
find_package(ament_cmake REQUIRED)
ament_package(
CONFIG_EXTRAS "rmw_implementation-extras.cmake"
)
install(
DIRECTORY cmake
DESTINATION share/${PROJECT_NAME}
)

View file

@ -1,10 +0,0 @@
#
# Get the package names of the available ROS middleware implemenations.
#
# :param var: the output variable name containing the package names
# :type var: list of strings
#
function(get_available_rmw_implementations var)
ament_index_get_resources(middleware_implementations "rmw_implementation")
set(${var} ${middleware_implementations} PARENT_SCOPE)
endfunction()

View file

@ -1,42 +0,0 @@
#
# Get the package name of the default ROS middleware implemenation.
#
# Either selcting it using the variable ROS_MIDDLEWARE_IMPLEMENTATION or
# choosing a default from the available implementations.
#
# :param var: the output variable name containing the package name
# :type var: string
#
function(get_default_rmw_implementation var)
get_available_rmw_implementations(middleware_implementations)
if("${middleware_implementations} " STREQUAL " ")
message(FATAL_ERROR "Could not find any ROS middleware implementation.")
endif()
# option()
if(NOT "${ROS_MIDDLEWARE_IMPLEMENTATION} " STREQUAL " ")
set(middleware_implementation "${ROS_MIDDLEWARE_IMPLEMENTATION}")
elseif(NOT "$ENV{ROS_MIDDLEWARE_IMPLEMENTATION} " STREQUAL " ")
set(middleware_implementation "$ENV{ROS_MIDDLEWARE_IMPLEMENTATION}")
else()
# TODO detemine "default" implementation based on the available ones
list(GET middleware_implementations 0 middleware_implementation)
endif()
# verify that the selection one is available
list(FIND middleware_implementations "${middleware_implementation}" _index)
if(_index EQUAL -1)
string(REPLACE ";" ", " middleware_implementations_string "${middleware_implementations}")
message(FATAL_ERROR "Could not find ROS middleware implementation '${middleware_implementation}'. Choose one of the following: ${middleware_implementations_string}")
endif()
find_package("${middleware_implementation}" REQUIRED)
# persist implementation decision in cache
set(
ROS_MIDDLEWARE_IMPLEMENTATION "${middleware_implementation}"
CACHE STRING "Select ROS middleware implementation to link against" FORCE
)
set(${var} ${middleware_implementation} PARENT_SCOPE)
endfunction()

View file

@ -1,15 +0,0 @@
<?xml version="1.0"?>
<package format="2">
<name>rmw_implementation</name>
<version>0.0.0</version>
<description>The decision which ROS middleware implementation should be used for C++.</description>
<maintainer email="dthomas@osrfoundation.org">Dirk Thomas</maintainer>
<license>Apache License 2.0</license>
<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_export_depend>ament_cmake</buildtool_export_depend>
<exec_depend>rmw_connext_cpp</exec_depend>
<exec_depend>rmw_connext_xtypes_dynamic_cpp</exec_depend>
<exec_depend>rmw_opensplice_cpp</exec_depend>
</package>

View file

@ -1,12 +0,0 @@
# copied from rmw_implementation/rmw_implementation-extras.cmake
include("${rmw_implementation_DIR}/get_available_rmw_implementations.cmake")
include("${rmw_implementation_DIR}/get_default_rmw_implementation.cmake")
get_default_rmw_implementation(_middleware_implementation)
find_package("${_middleware_implementation}" REQUIRED)
# TODO should never need definitions and include dirs?
list(APPEND rmw_implementation_DEFINITIONS ${${_middleware_implementation}_DEFINITIONS})
list(APPEND rmw_implementation_INCLUDE_DIRS ${${_middleware_implementation}_INCLUDE_DIRS})
list(APPEND rmw_implementation_LIBRARIES ${${_middleware_implementation}_LIBRARIES})