2024-09-23 16:01:31 +08:00
|
|
|
# Copyright (c) 2023, AgiBot Inc.
|
|
|
|
# All rights reserved.
|
|
|
|
|
|
|
|
include(FetchContent)
|
|
|
|
|
|
|
|
message(STATUS "Getting zenohc...")
|
|
|
|
|
|
|
|
# fetch zenoh-c
|
|
|
|
set(zenohc_DOWNLOAD_URL
|
2024-10-16 19:39:38 +08:00
|
|
|
"https://github.com/eclipse-zenoh/zenoh-c/archive/refs/tags/1.0.0.11.tar.gz"
|
2024-09-23 16:01:31 +08:00
|
|
|
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()
|
|
|
|
|
2024-11-07 21:17:34 +08:00
|
|
|
# Wrap it in a function to restrict the scope of the variables
|
|
|
|
function(get_zenohc)
|
|
|
|
FetchContent_GetProperties(zenohc)
|
|
|
|
if(NOT zenohc_POPULATED)
|
2024-11-15 18:42:59 +08:00
|
|
|
set(ZENOHC_BUILD_WITH_UNSTABLE_API
|
|
|
|
TRUE
|
|
|
|
CACHE BOOL "Enable unstable API")
|
|
|
|
set(ZENOHC_BUILD_WITH_SHARED_MEMORY
|
|
|
|
TRUE
|
|
|
|
CACHE BOOL "Enable shared memory")
|
2024-11-07 21:17:34 +08:00
|
|
|
FetchContent_MakeAvailable(zenohc)
|
|
|
|
endif()
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
get_zenohc()
|