Skip to content

Commit

Permalink
build!: build rmw_zenoh_cpp with zenoh-cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
YuanYuYuan committed Aug 29, 2024
1 parent 83a26f2 commit b6bd226
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 6 deletions.
4 changes: 3 additions & 1 deletion rmw_zenoh_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ find_package(rcutils REQUIRED)
find_package(rosidl_typesupport_fastrtps_c REQUIRED)
find_package(rosidl_typesupport_fastrtps_cpp REQUIRED)
find_package(rmw REQUIRED)
find_package(zenoh_c_vendor REQUIRED)
find_package(zenoh_cpp_vendor REQUIRED)

add_library(rmw_zenoh_cpp SHARED
src/detail/attachment_helpers.cpp
Expand Down Expand Up @@ -62,6 +62,7 @@ target_link_libraries(rmw_zenoh_cpp
rosidl_typesupport_fastrtps_cpp::rosidl_typesupport_fastrtps_cpp
rmw::rmw
zenohc::lib
zenohcxx::zenohc
)

configure_rmw_library(rmw_zenoh_cpp)
Expand Down Expand Up @@ -123,6 +124,7 @@ target_link_libraries(rmw_zenohd
rcpputils::rcpputils
rmw::rmw
zenohc::lib
zenohcxx::zenohc
)

install(
Expand Down
4 changes: 2 additions & 2 deletions rmw_zenoh_cpp/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

<buildtool_depend>ament_cmake</buildtool_depend>

<build_depend>zenoh_c_vendor</build_depend>
<build_export_depend>zenoh_c_vendor</build_export_depend>
<build_depend>zenoh_cpp_vendor</build_depend>
<build_export_depend>zenoh_cpp_vendor</build_export_depend>

<depend>ament_index_cpp</depend>
<depend>fastcdr</depend>
Expand Down
2 changes: 1 addition & 1 deletion rmw_zenoh_cpp/src/rmw_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include <cstdio>
#include <optional>
#include <zenoh.h>
#include <zenoh.hxx>

#include <new>
#include <string>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.16)
project(zenoh_c_vendor)
project(zenoh_cpp_vendor)

# Default to C++17
if(NOT CMAKE_CXX_STANDARD)
Expand Down Expand Up @@ -33,4 +33,15 @@ ament_vendor(zenoh_c_vendor

ament_export_dependencies(zenohc)

ament_vendor(zenoh_cpp_vendor
VCS_URL https://github.com/eclipse-zenoh/zenoh-cpp
VCS_VERSION dev/1.0.0
CMAKE_ARGS
-DZENOHCXX_ZENOHC=OFF
)

externalproject_add_stepdependencies(zenoh_cpp_vendor configure zenoh_c_vendor)

ament_export_dependencies(zenohcxx)

ament_package()
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>zenoh_c_vendor</name>
<name>zenoh_cpp_vendor</name>
<version>0.0.1</version>
<description>Vendor pkg to install zenoh-c</description>
<maintainer email="[email protected]">Yadunund</maintainer>
Expand Down

0 comments on commit b6bd226

Please sign in to comment.