Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ add_library(zenohcxx INTERFACE)
target_include_directories(zenohcxx INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include")

if(ZENOHCXX_ZENOHPICO)
include(FetchContent)
include(zenoh-pico)

if(NOT TARGET zenohpico::lib) # Only find if target is not already available
find_package(zenohpico REQUIRED)
endif()
Expand All @@ -58,6 +61,9 @@ if(ZENOHCXX_ZENOHPICO)
endif()

if(ZENOHCXX_ZENOHC)
include(FetchContent)
include(zenoh-c)

if(NOT TARGET zenohc::lib) # Only find if target is not already available
find_package(zenohc REQUIRED)
endif()
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ C++ bindings are still under active development so the Zenoh team will highly ap
## Requirements

The only hard requirement for building the library is a C++17-compliant compiler.
Using the library requires either [zenoh-c] or [zenoh-pico] to be installed.

-------------------------------

Expand Down
9 changes: 9 additions & 0 deletions cmake/zenoh-c.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

FetchContent_Declare(
zenohc
GIT_REPOSITORY https://github.com/eclipse-zenoh/zenoh-c.git
GIT_TAG main
GIT_SHALLOW TRUE
)

FetchContent_MakeAvailable(zenohc)
9 changes: 9 additions & 0 deletions cmake/zenoh-pico.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

FetchContent_Declare(
zenohpico
GIT_REPOSITORY https://github.com/eclipse-zenoh/zenoh-pico.git
GIT_TAG main
GIT_SHALLOW TRUE
)

FetchContent_MakeAvailable(zenohpico)
6 changes: 5 additions & 1 deletion tests/build/warnings.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@
//

// Disable 'old-style-cast` warning for C headers only
// Disable 'pedantic` warning due to "ISO C++ forbids compound-literals [-Werror=pedantic]"
// Disable 'missing-field-initializers` warning doe to missing initializations
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4996)
#else
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wold-style-cast"
#pragma GCC diagnostic ignored "-Wpedantic"
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
#endif

#ifdef ZENOHCXX_ZENOHPICO
Expand All @@ -38,4 +42,4 @@

using namespace zenoh;

int main() { return 0; }
int main() { return 0; }
Loading