From b39efafd623cf3cf476a136fbd70b824e0c3fde2 Mon Sep 17 00:00:00 2001 From: Dan Rose Date: Wed, 18 Sep 2019 12:49:39 -0500 Subject: [PATCH] make cyclonedds vender package play nice with colcon (#34) * Un-vendor cyclonedds Upstream changes in https://github.com/eclipse-cyclonedds/cyclonedds/pull/256 should make this unnecessary and allow you to clone the package into your ROS workspace. * Remove obsolete gitignore * Recommend cloning eclipse-cyclonedds/cyclonedds --- README.md | 8 +++----- cyclonedds_vendor/CMakeLists.txt | 14 -------------- cyclonedds_vendor/package.xml | 15 --------------- rmw_cyclonedds_cpp/CMakeLists.txt | 10 +--------- rmw_cyclonedds_cpp/package.xml | 1 - 5 files changed, 4 insertions(+), 44 deletions(-) delete mode 100644 cyclonedds_vendor/CMakeLists.txt delete mode 100644 cyclonedds_vendor/package.xml diff --git a/README.md b/README.md index 5d5841d..152471d 100644 --- a/README.md +++ b/README.md @@ -11,14 +11,12 @@ source directory, and then run colcon build in the usual manner: cd ros2_ws/src git clone https://github.com/atolab/rmw_cyclonedds + git clone https://github.com/eclipse-cyclonedds/cyclonedds cd .. rosdep install --from src -i - colcon build --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCYCLONEDDS_FROM_SOURCE=ON + colcon build export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp -If you prefer to install CycloneDDS yourself, set `-DCYCLONEDDS_FROM_SOURCE=OFF`. CMake caches this -value, so you can omit it between builds - This seems to work fine on Linux with a binary ROS2 installation as well as when building ROS2 from source. On macOS it has only been tested in a source build on a machine in an "unsupported" configuration (macOS 10.14 with SIP enabled, instead of 10.12 with SIP disabled), and apart from a @@ -26,7 +24,7 @@ few details that are caused by the machine configuration, that works fine, too. why it wouldn't work the same on Windows, but I haven't tried. If you want to use a pre-existing installation of Cyclone DDS, you don't need to clone it, but you -may have to tell CMake where to look for it using the CycloneDDS\_DIR variable. That also appears +may have to tell CMake where to look for it using the `CycloneDDS_DIR` variable. That also appears to be the case if there are other packages in the ROS2 workspace that you would like to use Cyclone DDS directly instead of via the ROS2 abstraction. diff --git a/cyclonedds_vendor/CMakeLists.txt b/cyclonedds_vendor/CMakeLists.txt deleted file mode 100644 index e2a3233..0000000 --- a/cyclonedds_vendor/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -cmake_minimum_required(VERSION 3.5) -project(cyclonedds_vendor) -find_package(ament_cmake REQUIRED) - -include(ExternalProject) -ExternalProject_Add(cyclonedds - GIT_REPOSITORY "https://github.com/eclipse-cyclonedds/cyclonedds.git" - CMAKE_ARGS - -DBUILD_CONFTOOL:BOOL=OFF - -DBUILD_IDLC:BOOL=OFF - -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} - ) - -ament_package() \ No newline at end of file diff --git a/cyclonedds_vendor/package.xml b/cyclonedds_vendor/package.xml deleted file mode 100644 index 668fada..0000000 --- a/cyclonedds_vendor/package.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - cyclonedds_vendor - 0.4.0 - Wrapper package for Eclipse CycloneDDS. - Erik Boasson - Apache License 2.0 - - ament_cmake - - - ament_cmake - - diff --git a/rmw_cyclonedds_cpp/CMakeLists.txt b/rmw_cyclonedds_cpp/CMakeLists.txt index 28818d3..9e823ad 100644 --- a/rmw_cyclonedds_cpp/CMakeLists.txt +++ b/rmw_cyclonedds_cpp/CMakeLists.txt @@ -16,8 +16,6 @@ cmake_minimum_required(VERSION 3.5) project(rmw_cyclonedds_cpp) -set(CYCLONEDDS_FROM_SOURCE CACHE BOOL "Should we download and build cycloneDDS from source?") - link_directories(/usr/local/lib) # Default to C++14 @@ -33,13 +31,7 @@ find_package(ament_cmake_ros REQUIRED) find_package(rcutils REQUIRED) -if(CYCLONEDDS_FROM_SOURCE) - message("Building CycloneDDS from source") - find_package(cyclonedds_vendor REQUIRED) -else() - find_package(cyclonedds_cmake_module REQUIRED) - message("Using installed CycloneDDS") -endif() +find_package(cyclonedds_cmake_module REQUIRED) find_package(CycloneDDS REQUIRED CONFIG) find_package(rmw REQUIRED) diff --git a/rmw_cyclonedds_cpp/package.xml b/rmw_cyclonedds_cpp/package.xml index acf0782..69dfc54 100644 --- a/rmw_cyclonedds_cpp/package.xml +++ b/rmw_cyclonedds_cpp/package.xml @@ -14,7 +14,6 @@ cyclonedds cyclonedds_cmake_module - cyclonedds_vendor rcutils rmw