diff --git a/CMakeLists.txt b/CMakeLists.txt index 13e69a8d..6d601711 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() @@ -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() diff --git a/README.md b/README.md index dcc7e20c..bd1ca6c0 100644 --- a/README.md +++ b/README.md @@ -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. ------------------------------- diff --git a/cmake/zenoh-c.cmake b/cmake/zenoh-c.cmake new file mode 100644 index 00000000..2c0250b8 --- /dev/null +++ b/cmake/zenoh-c.cmake @@ -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) diff --git a/cmake/zenoh-pico.cmake b/cmake/zenoh-pico.cmake new file mode 100644 index 00000000..3303e3b8 --- /dev/null +++ b/cmake/zenoh-pico.cmake @@ -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) diff --git a/tests/build/warnings.cxx b/tests/build/warnings.cxx index b98afc6f..78ff75cc 100644 --- a/tests/build/warnings.cxx +++ b/tests/build/warnings.cxx @@ -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 @@ -38,4 +42,4 @@ using namespace zenoh; -int main() { return 0; } \ No newline at end of file +int main() { return 0; }