Skip to content

Commit

Permalink
Replaced ament_vendor with ExternalProject
Browse files Browse the repository at this point in the history
  • Loading branch information
imstevenpmwork committed Aug 13, 2024
1 parent 8192f62 commit 62c3f54
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions zenoh_c_vendor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if(NOT CMAKE_CXX_STANDARD)
endif()

find_package(ament_cmake REQUIRED)
find_package(ament_cmake_vendor_package REQUIRED)
# find_package(ament_cmake_vendor_package REQUIRED)

# Disable default features and enable only the most useful ones. This reduces build time and footprint.
# For a complete list of features see: https://github.com/eclipse-zenoh/zenoh/blob/main/zenoh/Cargo.toml
Expand All @@ -23,11 +23,25 @@ set(ZENOHC_CARGO_FLAGS "--no-default-features$<SEMICOLON>--features=zenoh/shared
# - https://github.com/eclipse-zenoh/zenoh/pull/1022 (fix empty messages received if payload >btach size)
# - https://github.com/eclipse-zenoh/zenoh-c/pull/358 (fix debian packaging issue: https://github.com/jspricke/ros-deb-builder-action/issues/49)
# - https://github.com/eclipse-zenoh/zenoh/pull/1150 (fix deadlock issue https://github.com/ros2/rmw_zenoh/issues/182)
ament_vendor(zenoh_c_vendor
VCS_URL https://github.com/eclipse-zenoh/zenoh-c.git
VCS_VERSION 548ee8dde0f53a58c06e68a2949949b31140c36c
CMAKE_ARGS
"-DZENOHC_CARGO_FLAGS=${ZENOHC_CARGO_FLAGS}"
# ament_vendor(zenoh_c_vendor
# VCS_URL https://github.com/eclipse-zenoh/zenoh-c.git
# VCS_VERSION 548ee8dde0f53a58c06e68a2949949b31140c36c
# CMAKE_ARGS
# "-DZENOHC_CARGO_FLAGS=${ZENOHC_CARGO_FLAGS}"
# )

include(ExternalProject)
set(ZENOHC_INSTALL_DIR ${CMAKE_INSTALL_PREFIX})
ExternalProject_Add(zenohc
PREFIX ${CMAKE_BINARY_DIR}/zenohc
GIT_REPOSITORY https://github.com/eclipse-zenoh/zenoh-c.git
GIT_TAG 548ee8dde0f53a58c06e68a2949949b31140c36c
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${ZENOHC_INSTALL_DIR} -DZENOHC_CARGO_FLAGS=${ZENOHC_CARGO_FLAGS}
BUILD_IN_SOURCE 1
)
add_custom_target(zenoh_c_vendor ALL
DEPENDS zenohc
)
list(APPEND CMAKE_PREFIX_PATH ${ZENOHC_INSTALL_DIR})

ament_package()
ament_package()

0 comments on commit 62c3f54

Please sign in to comment.