AimRT/cmake/GetZenoh.cmake
han J 062ffad431
feat: zenoh plugin with shm (#96)
* add zenoh-shm API

* use zenoh shm-api for channel and rpc

* set z_alloc_result as a local variable.

* add zenoh_buffer_array_allocator

* avoid copy opreation when pub data with shm

* if shm pool size is not enough, use net buffer instead

* add z_pub_shm_size_map_ to store topic-loan_size

* little fix

* remove client send data 's copying

* remove server send data 's copy

* add doc

* change benchamrk  item

* minor modification

---------

Co-authored-by: hanjun <hanjun@agibot.com>
2024-11-15 18:42:59 +08:00

41 lines
943 B
CMake

# Copyright (c) 2023, AgiBot Inc.
# All rights reserved.
include(FetchContent)
message(STATUS "Getting zenohc...")
# fetch zenoh-c
set(zenohc_DOWNLOAD_URL
"https://github.com/eclipse-zenoh/zenoh-c/archive/refs/tags/1.0.0.11.tar.gz"
CACHE STRING "")
if(zenohc_LOCAL_SOURCE)
FetchContent_Declare(
zenohc
SOURCE_DIR ${zenohc_LOCAL_SOURCE}
OVERRIDE_FIND_PACKAGE)
else()
FetchContent_Declare(
zenohc
URL ${zenohc_DOWNLOAD_URL}
DOWNLOAD_EXTRACT_TIMESTAMP ON
OVERRIDE_FIND_PACKAGE)
endif()
# Wrap it in a function to restrict the scope of the variables
function(get_zenohc)
FetchContent_GetProperties(zenohc)
if(NOT zenohc_POPULATED)
set(ZENOHC_BUILD_WITH_UNSTABLE_API
TRUE
CACHE BOOL "Enable unstable API")
set(ZENOHC_BUILD_WITH_SHARED_MEMORY
TRUE
CACHE BOOL "Enable shared memory")
FetchContent_MakeAvailable(zenohc)
endif()
endfunction()
get_zenohc()