Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 45 additions & 37 deletions zenoh_cpp_vendor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,45 +10,53 @@ endif()
find_package(ament_cmake REQUIRED)
find_package(ament_cmake_vendor_package REQUIRED)

# Add a set of usefull features that are not enabled by default in zenoh-c.
# For a complete list of features see: https://github.com/eclipse-zenoh/zenoh/blob/main/zenoh/Cargo.toml
# Note: the list of features are separated with whitespaces.
# However, if you want to add other cargo build flags, use "$<SEMICOLON>" as separator and not ";" as the
# latter is a list separater in cmake and hence the string will be split into two when expanded.
set(ZENOHC_CARGO_FLAGS "--features=shared-memory zenoh/transport_serial")

# Set VCS_VERSION to 1.7.1 commits of zenoh/zenoh-c/zenoh-cpp to benefit from:
# * Query cancellation
# - https://github.com/eclipse-zenoh/zenoh/pull/2223
# - https://github.com/eclipse-zenoh/zenoh-c/pull/1134
# - https://github.com/eclipse-zenoh/zenoh-cpp/pull/663
# * Access to transport optimization SHM provider
# - https://github.com/eclipse-zenoh/zenoh/pull/2221
# - https://github.com/eclipse-zenoh/zenoh-c/pull/1132
# - https://github.com/eclipse-zenoh/zenoh-cpp/pull/654
# * Metrics per key (requires to add "zenoh/stats" feature to ZENOHC_CARGO_FLAGS for build)
# - https://github.com/eclipse-zenoh/zenoh/pull/2284
ament_vendor(zenoh_c_vendor
VCS_URL https://github.com/eclipse-zenoh/zenoh-c.git
VCS_VERSION 73e7a0bdcf78b8263a02b7aee453ee6de8187589
CMAKE_ARGS
"-DZENOHC_CARGO_FLAGS=${ZENOHC_CARGO_FLAGS}"
"-DZENOHC_BUILD_WITH_UNSTABLE_API=TRUE"
"-DZENOHC_CUSTOM_TARGET=${ZENOHC_CUSTOM_TARGET}"
PATCHES ${CMAKE_CURRENT_SOURCE_DIR}/pin-rust-1.75.0.patch
)
option(USE_SYSTEM_ZENOH "Use non-vendored zenoh from the system" OFF)

if(USE_SYSTEM_ZENOH)
find_package(zenohc REQUIRED)
find_package(zenohcxx REQUIRED)
message(STATUS "Using system zenohc version: ${zenohc_VERSION}")
message(STATUS "Using system zenohcxx version: ${zenohcxx_VERSION}")
else()
# Add a set of usefull features that are not enabled by default in zenoh-c.
# For a complete list of features see: https://github.com/eclipse-zenoh/zenoh/blob/main/zenoh/Cargo.toml
# Note: the list of features are separated with whitespaces.
# However, if you want to add other cargo build flags, use "$<SEMICOLON>" as separator and not ";" as the
# latter is a list separater in cmake and hence the string will be split into two when expanded.
set(ZENOHC_CARGO_FLAGS "--features=shared-memory zenoh/transport_serial")
Comment thread
JEnoch marked this conversation as resolved.

# Set VCS_VERSION to 1.7.1 commits of zenoh/zenoh-c/zenoh-cpp to benefit from:
# * Query cancellation
# - https://github.com/eclipse-zenoh/zenoh/pull/2223
# - https://github.com/eclipse-zenoh/zenoh-c/pull/1134
# - https://github.com/eclipse-zenoh/zenoh-cpp/pull/663
# * Access to transport optimization SHM provider
# - https://github.com/eclipse-zenoh/zenoh/pull/2221
# - https://github.com/eclipse-zenoh/zenoh-c/pull/1132
# - https://github.com/eclipse-zenoh/zenoh-cpp/pull/654
# * Metrics per key (requires to add "zenoh/stats" feature to ZENOHC_CARGO_FLAGS for build)
# - https://github.com/eclipse-zenoh/zenoh/pull/2284
ament_vendor(zenoh_c_vendor
VCS_URL https://github.com/eclipse-zenoh/zenoh-c.git
VCS_VERSION 73e7a0bdcf78b8263a02b7aee453ee6de8187589
CMAKE_ARGS
"-DZENOHC_CARGO_FLAGS=${ZENOHC_CARGO_FLAGS}"
"-DZENOHC_BUILD_WITH_UNSTABLE_API=TRUE"
"-DZENOHC_CUSTOM_TARGET=${ZENOHC_CUSTOM_TARGET}"
PATCHES ${CMAKE_CURRENT_SOURCE_DIR}/pin-rust-1.75.0.patch
)

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

externalproject_add_stepdependencies(zenoh_cpp_vendor configure zenoh_c_vendor)
endif()

ament_export_dependencies(zenohc)

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

externalproject_add_stepdependencies(zenoh_cpp_vendor configure zenoh_c_vendor)

ament_export_dependencies(zenohcxx)

ament_package()