-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'zenoh/master' into freertos
- Loading branch information
Showing
20 changed files
with
312 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# .readthedocs.yaml | ||
# Read the Docs configuration file | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
# Required | ||
version: 2 | ||
|
||
# Set the version of Python and other tools you might need | ||
build: | ||
os: ubuntu-22.04 | ||
tools: | ||
python: "3.11" | ||
apt_packages: | ||
- libclang-dev | ||
|
||
# Build documentation in the docs/ directory with Sphinx | ||
sphinx: | ||
configuration: docs/conf.py | ||
|
||
# We recommend specifying your dependencies to enable reproducible builds: | ||
# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html | ||
python: | ||
install: | ||
- requirements: docs/requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,9 +11,11 @@ | |
# Contributors: | ||
# ZettaScale Zenoh Team, <[email protected]> | ||
# | ||
cmake_minimum_required(VERSION 3.8) | ||
cmake_minimum_required(VERSION 3.13) | ||
|
||
project(libzenohpico VERSION 0.10.0.0 LANGUAGES C) | ||
project(zenohpico VERSION 0.10.0.0 LANGUAGES C) | ||
|
||
include(CMakePackageConfigHelpers) | ||
|
||
option(BUILD_SHARED_LIBS "Build shared libraries if ON, otherwise build static libraries" ON) | ||
option(ZENOH_DEBUG "Use this to set the ZENOH_DEBUG variable." 0) | ||
|
@@ -62,8 +64,14 @@ if(NOT CMAKE_BUILD_TYPE) | |
endif() | ||
string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE) | ||
|
||
|
||
set(CHECK_THREADS "ON") | ||
|
||
if(CMAKE_SYSTEM_NAME MATCHES "Linux") | ||
add_definition(ZENOH_LINUX) | ||
elseif(POSIX_COMPATIBLE) | ||
add_definition(ZENOH_LINUX) | ||
set(CHECK_THREADS "OFF") | ||
elseif(CMAKE_SYSTEM_NAME MATCHES "BSD") | ||
add_definition(ZENOH_BSD) | ||
elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin") | ||
|
@@ -103,7 +111,9 @@ if(SKBUILD) | |
endif() | ||
|
||
set(THREADS_PREFER_PTHREAD_FLAG ON) | ||
find_package(Threads REQUIRED) | ||
if(CHECK_THREADS) | ||
find_package(Threads REQUIRED) | ||
endif() | ||
|
||
if(CMAKE_BUILD_TYPE MATCHES "DEBUG") | ||
if(UNIX) | ||
|
@@ -167,7 +177,7 @@ if(WITH_ZEPHYR) | |
elseif(WITH_FREERTOS_PLUS_TCP) | ||
file (GLOB Sources_Freertos_Plus_TCP "src/system/freertos_plus_tcp/*.c") | ||
list(APPEND Sources ${Sources_Freertos_Plus_TCP}) | ||
elseif(CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "Darwin" OR CMAKE_SYSTEM_NAME MATCHES "BSD") | ||
elseif(CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "Darwin" OR CMAKE_SYSTEM_NAME MATCHES "BSD" OR POSIX_COMPATIBLE) | ||
file (GLOB Sources_Unix "src/system/unix/*.c") | ||
list(APPEND Sources ${Sources_Unix}) | ||
elseif(CMAKE_SYSTEM_NAME MATCHES "Emscripten") | ||
|
@@ -183,7 +193,9 @@ link_directories(${LIBRARY_OUTPUT_PATH}) | |
|
||
target_sources(${Libname} PRIVATE ${Sources}) | ||
|
||
target_link_libraries(${Libname} Threads::Threads) | ||
if(CHECK_THREADS) | ||
target_link_libraries(${Libname} Threads::Threads) | ||
endif() | ||
|
||
if(CMAKE_SYSTEM_NAME MATCHES "Linux") | ||
target_link_libraries(${Libname} rt) | ||
|
@@ -224,6 +236,31 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/zenoh-pico | |
COMPONENT Headers | ||
) | ||
|
||
set(CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/zenohpico") | ||
# Generate <Package>Config.cmake | ||
configure_package_config_file( | ||
"PackageConfig.cmake.in" | ||
"${CMAKE_CURRENT_BINARY_DIR}/zenohpicoConfig.cmake" | ||
INSTALL_DESTINATION "${CMAKE_INSTALL_CMAKEDIR}") | ||
|
||
# Generate <Package>Version.cmake | ||
write_basic_package_version_file( | ||
"${CMAKE_CURRENT_BINARY_DIR}/zenohpicoConfigVersion.cmake" | ||
VERSION ${PROJECT_VERSION} | ||
COMPATIBILITY SameMajorVersion) | ||
|
||
install( | ||
FILES "${CMAKE_CURRENT_BINARY_DIR}/zenohpicoConfig.cmake" | ||
"${CMAKE_CURRENT_BINARY_DIR}/zenohpicoConfigVersion.cmake" | ||
DESTINATION "${CMAKE_INSTALL_CMAKEDIR}" | ||
CONFIGURATIONS ${configurations} | ||
COMPONENT dev) | ||
|
||
if(UNIX) | ||
configure_file("${CMAKE_SOURCE_DIR}/zenohpico.pc.in" "${CMAKE_SOURCE_DIR}/zenohpico.pc" @ONLY) | ||
install(FILES "${CMAKE_SOURCE_DIR}/zenohpico.pc" CONFIGURATIONS Release RelWithDebInfo DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") | ||
endif() | ||
|
||
if(BUILD_EXAMPLES) | ||
add_subdirectory(examples) | ||
endif() | ||
|
@@ -370,4 +407,4 @@ if(PACKAGING) | |
include(CPack) | ||
endif() | ||
|
||
endif() | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# | ||
# Copyright (c) 2023 ZettaScale Technology. | ||
# | ||
# This program and the accompanying materials are made available under the | ||
# terms of the Eclipse Public License 2.0 which is available at | ||
# http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 | ||
# which is available at https://www.apache.org/licenses/LICENSE-2.0. | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 | ||
# | ||
# Contributors: | ||
# ZettaScale Zenoh team, <[email protected]> | ||
# | ||
|
||
@PACKAGE_INIT@ | ||
|
||
add_library(__zenohpico_static STATIC IMPORTED GLOBAL) | ||
add_library(zenohpico::static ALIAS __zenohpico_static) | ||
set_property(TARGET __zenohpico_static PROPERTY IMPORTED_LOCATION "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/@STATICLIB@") | ||
|
||
add_library(__zenohpico_lib SHARED IMPORTED GLOBAL) | ||
add_library(zenohpico::lib ALIAS __zenohpico_lib) | ||
set_target_properties(__zenohpico_lib PROPERTIES IMPORTED_NO_SONAME TRUE) | ||
set_property(TARGET __zenohpico_lib PROPERTY IMPORTED_LOCATION "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/@DYLIB@") | ||
if(NOT ("@IMPLIB@" STREQUAL "")) | ||
set_property(TARGET __zenohpico_lib PROPERTY IMPORTED_IMPLIB "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/@IMPLIB@") | ||
endif() | ||
target_include_directories(__zenohpico_lib INTERFACE "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.