From 9e1fab2e24a9e77f51eba50f18f4c38e6a1cc679 Mon Sep 17 00:00:00 2001 From: Oussama Teffahi Date: Tue, 16 Apr 2024 15:37:11 +0200 Subject: [PATCH 1/8] Add zenoh-c-from-source conan recipe --- conan-recipes/from-source/all/conandata.yml | 8 ++ conan-recipes/from-source/all/conanfile.py | 113 ++++++++++++++++++ ...0001-cmakelists-remove-cargo-channel.patch | 23 ++++ .../0002-cmakelists-build-lib-only.patch | 70 +++++++++++ .../all/test_package/CMakeLists.txt | 8 ++ .../from-source/all/test_package/conanfile.py | 30 +++++ .../all/test_package/test_package.c | 8 ++ conan-recipes/from-source/config.yml | 3 + 8 files changed, 263 insertions(+) create mode 100644 conan-recipes/from-source/all/conandata.yml create mode 100644 conan-recipes/from-source/all/conanfile.py create mode 100644 conan-recipes/from-source/all/patches/0001-cmakelists-remove-cargo-channel.patch create mode 100644 conan-recipes/from-source/all/patches/0002-cmakelists-build-lib-only.patch create mode 100644 conan-recipes/from-source/all/test_package/CMakeLists.txt create mode 100644 conan-recipes/from-source/all/test_package/conanfile.py create mode 100644 conan-recipes/from-source/all/test_package/test_package.c create mode 100644 conan-recipes/from-source/config.yml diff --git a/conan-recipes/from-source/all/conandata.yml b/conan-recipes/from-source/all/conandata.yml new file mode 100644 index 000000000..98b86b1dc --- /dev/null +++ b/conan-recipes/from-source/all/conandata.yml @@ -0,0 +1,8 @@ +sources: + "0.10.1-rc": + url: "https://github.com/eclipse-zenoh/zenoh-c/archive/refs/tags/0.10.1-rc.tar.gz" + sha256: "9fb703eff79b7c1ef216f411dadcb7f0132c8ba665823b5a8252b467b4937438" +patches: + "0.10.1-rc": + - patch_file: patches/0001-cmakelists-remove-cargo-channel.patch + - patch_file: patches/0002-cmakelists-build-lib-only.patch \ No newline at end of file diff --git a/conan-recipes/from-source/all/conanfile.py b/conan-recipes/from-source/all/conanfile.py new file mode 100644 index 000000000..f7dfa8989 --- /dev/null +++ b/conan-recipes/from-source/all/conanfile.py @@ -0,0 +1,113 @@ +from conan import ConanFile +from conan.errors import ConanInvalidConfiguration +from conan.tools.files import apply_conandata_patches, get, copy, export_conandata_patches +from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout, CMakeDeps +import os + +required_conan_version = ">=1.53.0" + +class ZenohCPackageConan(ConanFile): + name = "zenohc" + description = "C-API for Eclipse Zenoh: Zero Overhead Pub/sub, Store/Query and Compute protocol" + tags = ["iot", "networking", "robotics", "messaging", "ros2", "edge-computing", "micro-controller"] + license = "Apache License 2.0" + author = "ZettaScale Zenoh Team" + + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/eclipse-zenoh/zenoh-c" + + package_type = "library" + settings = "os", "compiler", "build_type", "arch" + + options = { + "shared": [True, False], + "fPIC": [True, False], + "ZENOHC_BUILD_WITH_LOGGER_AUTOINIT":[True, False], + "ZENOHC_BUILD_WITH_SHARED_MEMORY":[True, False], + "ZENOHC_CARGO_FLAGS": ["ANY"], + } + + default_options = { + "shared": False, + "fPIC": True, + "ZENOHC_BUILD_WITH_LOGGER_AUTOINIT": True, + "ZENOHC_BUILD_WITH_SHARED_MEMORY": True, + "ZENOHC_CARGO_FLAGS": "", + } + + @property + def _supported_platforms(self): + return [ + ("Windows", "x86_64"), + ("Linux", "x86_64"), + ("Linux", "armv6"), + ("Linux", "armv7hf"), + ("Linux", "armv8"), + ("Macos", "x86_64"), + ("Macos", "armv8"), + ] + + def export_sources(self): + export_conandata_patches(self) + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def configure(self): + if self.options.shared: + self.options.rm_safe("fPIC") + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def layout(self): + cmake_layout(self) + + def validate(self): + if (self.settings.os, self.settings.arch) not in self._supported_platforms: + raise ConanInvalidConfiguration("{}/{} combination is not supported".format(self.settings.os, self.settings.arch)) + + def build_requirements(self): + self.tool_requires("cmake/[>=3.16 <4]") + + def source(self): + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + for opt, val in self.options.items(): + tc.variables[opt] = val + tc.variables["ZENOHC_LIB_STATIC"] = str(not self.options.shared) + tc.variables["ZENOHC_INSTALL_STATIC_LIBRARY"] = tc.variables["ZENOHC_LIB_STATIC"] + + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def build(self): + apply_conandata_patches(self) + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + copy(self, "LICENSE", self.source_folder, os.path.join(self.package_folder, "licenses")) + cmake = CMake(self) + cmake.install() + + def package_info(self): + if self.settings.build_type == "Debug": + self.cpp_info.libs = ["zenohcd"] + else: + self.cpp_info.libs = ["zenohc"] + + self.cpp_info.set_property("cmake_file_name", "zenohc") + self.cpp_info.set_property("cmake_target_name", "zenohc::lib") + self.cpp_info.set_property("cmake_target_aliases", [f"zenohc::{'shared' if self.options.shared else 'static'}"]) + + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["ws2_32", "crypt32", "secur32", "bcrypt", "ncrypt", "userenv", "ntdll", "iphlpapi", "runtimeobject"] + elif self.settings.os == "Linux": + self.cpp_info.system_libs = ["rt", "pthread", "m", "dl"] + elif self.settings.os == "Macos": + self.cpp_info.frameworks = ["Foundation", "Security"] diff --git a/conan-recipes/from-source/all/patches/0001-cmakelists-remove-cargo-channel.patch b/conan-recipes/from-source/all/patches/0001-cmakelists-remove-cargo-channel.patch new file mode 100644 index 000000000..c1248b56e --- /dev/null +++ b/conan-recipes/from-source/all/patches/0001-cmakelists-remove-cargo-channel.patch @@ -0,0 +1,23 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 419b583..81527fb 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -27,7 +27,6 @@ declare_cache_var_true_if_vscode(ZENOHC_BUILD_IN_SOURCE_TREE "Do build inside so + declare_cache_var(ZENOHC_BUILD_WITH_LOGGER_AUTOINIT TRUE BOOL "Enable logger-autoinit zenoh-c feature") + declare_cache_var(ZENOHC_BUILD_WITH_SHARED_MEMORY TRUE BOOL "Enable shared-memory zenoh-c feature") + declare_cache_var(ZENOHC_CUSTOM_TARGET "" STRING "Rust target for cross compilation, 'aarch64-unknown-linux-gnu' for example") +-declare_cache_var(ZENOHC_CARGO_CHANNEL "stable" STRING "Cargo channel selected: stable or nightly") + declare_cache_var(ZENOHC_CARGO_FLAGS "" STRING "Additional cargo flags") + declare_cache_var(ZENOHC_LIB_STATIC FALSE BOOL "Alias zenohc::lib target to zenohc::static if TRUE, to zenohc::shared if FALSE") + +@@ -198,8 +197,8 @@ file(GLOB_RECURSE rust_sources "Cargo.toml.in" "src/*.rs" "build.rs" "splitguide + add_custom_command( + OUTPUT ${libs} + COMMAND ${CMAKE_COMMAND} -E echo \"RUSTFLAGS = $$RUSTFLAGS\" +- COMMAND ${CMAKE_COMMAND} -E echo \"cargo +${ZENOHC_CARGO_CHANNEL} build ${cargo_flags}\" +- COMMAND cargo +${ZENOHC_CARGO_CHANNEL} build ${cargo_flags} ++ COMMAND ${CMAKE_COMMAND} -E echo \"cargo build ${cargo_flags}\" ++ COMMAND cargo build ${cargo_flags} + VERBATIM + COMMAND_EXPAND_LISTS + DEPENDS "${rust_sources}" diff --git a/conan-recipes/from-source/all/patches/0002-cmakelists-build-lib-only.patch b/conan-recipes/from-source/all/patches/0002-cmakelists-build-lib-only.patch new file mode 100644 index 000000000..6b2dd18c0 --- /dev/null +++ b/conan-recipes/from-source/all/patches/0002-cmakelists-build-lib-only.patch @@ -0,0 +1,70 @@ +diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt +index c2aecbd..e69de29 100644 +--- a/examples/CMakeLists.txt ++++ b/examples/CMakeLists.txt +@@ -1,32 +0,0 @@ +-if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) +- # Settings when 'examples' is the root projet +- cmake_minimum_required(VERSION 3.16) +- project(zenohc_examples LANGUAGES C) +- set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../cmake" ${CMAKE_MODULE_PATH}) +- include(helpers) +- set_default_build_type(Release) +- configure_include_project(ZENOHC zenohc zenohc::lib ".." zenohc "https://github.com/eclipse-zenoh/zenoh-c" "") +- add_custom_target(examples ALL) +-else() +- message(STATUS "zenoh-c examples") +- add_custom_target(examples) +-endif() +- +-file(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/*.c") +- +-foreach(file ${files}) +- get_filename_component(target ${file} NAME_WE) +- +- if(NOT(UNIX) AND(${target} STREQUAL "z_ping" OR ${target} STREQUAL "z_pong")) +- continue() +- endif() +- +- add_executable(${target} EXCLUDE_FROM_ALL ${file}) +- add_dependencies(examples ${target}) +- +- add_dependencies(${target} zenohc::lib) +- target_link_libraries(${target} PRIVATE zenohc::lib) +- copy_dlls(${target}) +- +- set_property(TARGET ${target} PROPERTY C_STANDARD 11) +-endforeach() +diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt +index 21695a4..e69de29 100644 +--- a/tests/CMakeLists.txt ++++ b/tests/CMakeLists.txt +@@ -1,28 +0,0 @@ +-message(STATUS "zenoh-c tests") +- +-add_custom_target(tests) +- +-file(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/*.c") +-foreach(file ${files}) +- get_filename_component(target ${file} NAME_WE) +- +- # Check the filename prefix to determine the test type +- if (${file} MATCHES "^.*z_api_.*$") +- set(test_type "unit") +- elseif (${file} MATCHES "^.*z_int_.*$") +- set(test_type "integration") +- elseif (${file} MATCHES "^.*z_build_.*$") +- set(test_type "build") +- else() +- message(FATAL_ERROR "Test file ${file} does not match any known type (z_api_ or z_int_ or z_build)") +- endif() +- +- add_executable(${target} EXCLUDE_FROM_ALL ${file}) +- add_dependencies(tests ${target}) +- add_dependencies(${target} zenohc::lib) +- target_link_libraries(${target} PRIVATE zenohc::lib) +- copy_dlls(${target}) +- set_property(TARGET ${target} PROPERTY C_STANDARD 11) +- add_test(NAME "${test_type}_${target}" COMMAND ${target}) +-endforeach() +- diff --git a/conan-recipes/from-source/all/test_package/CMakeLists.txt b/conan-recipes/from-source/all/test_package/CMakeLists.txt new file mode 100644 index 000000000..3bde757f1 --- /dev/null +++ b/conan-recipes/from-source/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.16) + +project(test_package LANGUAGES C) + +find_package(zenohc REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE zenohc::lib) \ No newline at end of file diff --git a/conan-recipes/from-source/all/test_package/conanfile.py b/conan-recipes/from-source/all/test_package/conanfile.py new file mode 100644 index 000000000..291d7d744 --- /dev/null +++ b/conan-recipes/from-source/all/test_package/conanfile.py @@ -0,0 +1,30 @@ +import os +from conan import ConanFile +from conan.tools.cmake import CMake, cmake_layout +from conan.tools.build import can_run + + +class ZenohCPackageTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def configure(self): + self.settings.rm_safe("compiler.cppstd") + self.settings.rm_safe("compiler.libcxx") + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + cmd = os.path.join(self.cpp.build.bindir, "test_package") + self.run(cmd, env="conanrun") \ No newline at end of file diff --git a/conan-recipes/from-source/all/test_package/test_package.c b/conan-recipes/from-source/all/test_package/test_package.c new file mode 100644 index 000000000..899f4c15a --- /dev/null +++ b/conan-recipes/from-source/all/test_package/test_package.c @@ -0,0 +1,8 @@ +#include "zenoh.h" + +int main(int argc, char **argv) { + (void)argc; + (void)argv; + z_owned_config_t config = z_config_default(); + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/conan-recipes/from-source/config.yml b/conan-recipes/from-source/config.yml new file mode 100644 index 000000000..bae23e733 --- /dev/null +++ b/conan-recipes/from-source/config.yml @@ -0,0 +1,3 @@ +versions: + "0.10.1-rc": + folder: all \ No newline at end of file From c33d3897941e4ff81a58df93e566cc66f0867f47 Mon Sep 17 00:00:00 2001 From: Oussama Teffahi Date: Tue, 16 Apr 2024 15:40:26 +0200 Subject: [PATCH 2/8] Add copyright file header --- conan-recipes/from-source/all/conanfile.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/conan-recipes/from-source/all/conanfile.py b/conan-recipes/from-source/all/conanfile.py index f7dfa8989..acc9022c1 100644 --- a/conan-recipes/from-source/all/conanfile.py +++ b/conan-recipes/from-source/all/conanfile.py @@ -1,3 +1,16 @@ +# +# Copyright (c) 2024 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, +# from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.files import apply_conandata_patches, get, copy, export_conandata_patches From c90d785ac1db3760af4708be2138038626185517 Mon Sep 17 00:00:00 2001 From: Oussama Teffahi Date: Tue, 16 Apr 2024 15:41:09 +0200 Subject: [PATCH 3/8] Update license field --- conan-recipes/from-source/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conan-recipes/from-source/all/conanfile.py b/conan-recipes/from-source/all/conanfile.py index acc9022c1..e16c6619e 100644 --- a/conan-recipes/from-source/all/conanfile.py +++ b/conan-recipes/from-source/all/conanfile.py @@ -23,7 +23,7 @@ class ZenohCPackageConan(ConanFile): name = "zenohc" description = "C-API for Eclipse Zenoh: Zero Overhead Pub/sub, Store/Query and Compute protocol" tags = ["iot", "networking", "robotics", "messaging", "ros2", "edge-computing", "micro-controller"] - license = "Apache License 2.0" + license = "EPL-2.0 OR Apache-2.0" author = "ZettaScale Zenoh Team" url = "https://github.com/conan-io/conan-center-index" From b8cf5e1cc768d07fd435a0f21ff8ebbac18632d1 Mon Sep 17 00:00:00 2001 From: Oussama Teffahi Date: Tue, 16 Apr 2024 15:55:03 +0200 Subject: [PATCH 4/8] Move install static library to options --- conan-recipes/from-source/all/conanfile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conan-recipes/from-source/all/conanfile.py b/conan-recipes/from-source/all/conanfile.py index e16c6619e..07c7b7405 100644 --- a/conan-recipes/from-source/all/conanfile.py +++ b/conan-recipes/from-source/all/conanfile.py @@ -37,6 +37,7 @@ class ZenohCPackageConan(ConanFile): "fPIC": [True, False], "ZENOHC_BUILD_WITH_LOGGER_AUTOINIT":[True, False], "ZENOHC_BUILD_WITH_SHARED_MEMORY":[True, False], + "ZENOHC_INSTALL_STATIC_LIBRARY":[True, False], "ZENOHC_CARGO_FLAGS": ["ANY"], } @@ -45,6 +46,7 @@ class ZenohCPackageConan(ConanFile): "fPIC": True, "ZENOHC_BUILD_WITH_LOGGER_AUTOINIT": True, "ZENOHC_BUILD_WITH_SHARED_MEMORY": True, + "ZENOHC_INSTALL_STATIC_LIBRARY": False, "ZENOHC_CARGO_FLAGS": "", } @@ -91,7 +93,6 @@ def generate(self): for opt, val in self.options.items(): tc.variables[opt] = val tc.variables["ZENOHC_LIB_STATIC"] = str(not self.options.shared) - tc.variables["ZENOHC_INSTALL_STATIC_LIBRARY"] = tc.variables["ZENOHC_LIB_STATIC"] tc.generate() deps = CMakeDeps(self) From e90582be7addcdf6dd19be95a8b76c67b73490a4 Mon Sep 17 00:00:00 2001 From: Oussama Teffahi Date: Tue, 16 Apr 2024 16:10:31 +0200 Subject: [PATCH 5/8] Patch source to force Rust 1.72.0 for 0.10.1-rc --- conan-recipes/from-source/all/conandata.yml | 2 +- ...hannel.patch => 0001-cmakelists-patch-cargo-channel.patch} | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename conan-recipes/from-source/all/patches/{0001-cmakelists-remove-cargo-channel.patch => 0001-cmakelists-patch-cargo-channel.patch} (91%) diff --git a/conan-recipes/from-source/all/conandata.yml b/conan-recipes/from-source/all/conandata.yml index 98b86b1dc..34e177054 100644 --- a/conan-recipes/from-source/all/conandata.yml +++ b/conan-recipes/from-source/all/conandata.yml @@ -4,5 +4,5 @@ sources: sha256: "9fb703eff79b7c1ef216f411dadcb7f0132c8ba665823b5a8252b467b4937438" patches: "0.10.1-rc": - - patch_file: patches/0001-cmakelists-remove-cargo-channel.patch + - patch_file: patches/0001-cmakelists-patch-cargo-channel.patch - patch_file: patches/0002-cmakelists-build-lib-only.patch \ No newline at end of file diff --git a/conan-recipes/from-source/all/patches/0001-cmakelists-remove-cargo-channel.patch b/conan-recipes/from-source/all/patches/0001-cmakelists-patch-cargo-channel.patch similarity index 91% rename from conan-recipes/from-source/all/patches/0001-cmakelists-remove-cargo-channel.patch rename to conan-recipes/from-source/all/patches/0001-cmakelists-patch-cargo-channel.patch index c1248b56e..630987473 100644 --- a/conan-recipes/from-source/all/patches/0001-cmakelists-remove-cargo-channel.patch +++ b/conan-recipes/from-source/all/patches/0001-cmakelists-patch-cargo-channel.patch @@ -16,8 +16,8 @@ index 419b583..81527fb 100644 COMMAND ${CMAKE_COMMAND} -E echo \"RUSTFLAGS = $$RUSTFLAGS\" - COMMAND ${CMAKE_COMMAND} -E echo \"cargo +${ZENOHC_CARGO_CHANNEL} build ${cargo_flags}\" - COMMAND cargo +${ZENOHC_CARGO_CHANNEL} build ${cargo_flags} -+ COMMAND ${CMAKE_COMMAND} -E echo \"cargo build ${cargo_flags}\" -+ COMMAND cargo build ${cargo_flags} ++ COMMAND ${CMAKE_COMMAND} -E echo \"cargo +1.72.0 build ${cargo_flags}\" ++ COMMAND cargo +1.72.0 build ${cargo_flags} VERBATIM COMMAND_EXPAND_LISTS DEPENDS "${rust_sources}" From 20ec2cd16b7a54eb30780278e045049eb767fd03 Mon Sep 17 00:00:00 2001 From: Oussama Teffahi Date: Tue, 16 Apr 2024 17:36:51 +0200 Subject: [PATCH 6/8] Overwrite url attribute --- conan-recipes/from-source/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conan-recipes/from-source/all/conanfile.py b/conan-recipes/from-source/all/conanfile.py index 07c7b7405..916652690 100644 --- a/conan-recipes/from-source/all/conanfile.py +++ b/conan-recipes/from-source/all/conanfile.py @@ -26,7 +26,7 @@ class ZenohCPackageConan(ConanFile): license = "EPL-2.0 OR Apache-2.0" author = "ZettaScale Zenoh Team" - url = "https://github.com/conan-io/conan-center-index" + url = "https://github.com/eclipse-zenoh/zenoh-c" homepage = "https://github.com/eclipse-zenoh/zenoh-c" package_type = "library" From 25e799063d97ed925f34d7f2bc018af8df4982a4 Mon Sep 17 00:00:00 2001 From: Oussama Teffahi Date: Tue, 23 Apr 2024 14:38:41 +0200 Subject: [PATCH 7/8] Revert "Patch source to force Rust 1.72.0 for 0.10.1-rc" This reverts commit e90582be7addcdf6dd19be95a8b76c67b73490a4. Running Cargo without explicitely providing a channel will use the requested version in `rust-toolchain.toml`, it will be downloaded if it is not already installed. --- conan-recipes/from-source/all/conandata.yml | 2 +- ...annel.patch => 0001-cmakelists-remove-cargo-channel.patch} | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename conan-recipes/from-source/all/patches/{0001-cmakelists-patch-cargo-channel.patch => 0001-cmakelists-remove-cargo-channel.patch} (91%) diff --git a/conan-recipes/from-source/all/conandata.yml b/conan-recipes/from-source/all/conandata.yml index 34e177054..98b86b1dc 100644 --- a/conan-recipes/from-source/all/conandata.yml +++ b/conan-recipes/from-source/all/conandata.yml @@ -4,5 +4,5 @@ sources: sha256: "9fb703eff79b7c1ef216f411dadcb7f0132c8ba665823b5a8252b467b4937438" patches: "0.10.1-rc": - - patch_file: patches/0001-cmakelists-patch-cargo-channel.patch + - patch_file: patches/0001-cmakelists-remove-cargo-channel.patch - patch_file: patches/0002-cmakelists-build-lib-only.patch \ No newline at end of file diff --git a/conan-recipes/from-source/all/patches/0001-cmakelists-patch-cargo-channel.patch b/conan-recipes/from-source/all/patches/0001-cmakelists-remove-cargo-channel.patch similarity index 91% rename from conan-recipes/from-source/all/patches/0001-cmakelists-patch-cargo-channel.patch rename to conan-recipes/from-source/all/patches/0001-cmakelists-remove-cargo-channel.patch index 630987473..c1248b56e 100644 --- a/conan-recipes/from-source/all/patches/0001-cmakelists-patch-cargo-channel.patch +++ b/conan-recipes/from-source/all/patches/0001-cmakelists-remove-cargo-channel.patch @@ -16,8 +16,8 @@ index 419b583..81527fb 100644 COMMAND ${CMAKE_COMMAND} -E echo \"RUSTFLAGS = $$RUSTFLAGS\" - COMMAND ${CMAKE_COMMAND} -E echo \"cargo +${ZENOHC_CARGO_CHANNEL} build ${cargo_flags}\" - COMMAND cargo +${ZENOHC_CARGO_CHANNEL} build ${cargo_flags} -+ COMMAND ${CMAKE_COMMAND} -E echo \"cargo +1.72.0 build ${cargo_flags}\" -+ COMMAND cargo +1.72.0 build ${cargo_flags} ++ COMMAND ${CMAKE_COMMAND} -E echo \"cargo build ${cargo_flags}\" ++ COMMAND cargo build ${cargo_flags} VERBATIM COMMAND_EXPAND_LISTS DEPENDS "${rust_sources}" From c75c4de1ec4b4e91a6648b80b71aba6726468526 Mon Sep 17 00:00:00 2001 From: Oussama Teffahi Date: Tue, 23 Apr 2024 14:49:19 +0200 Subject: [PATCH 8/8] Add cmake to test_package build_requirements --- conan-recipes/from-source/all/test_package/conanfile.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/conan-recipes/from-source/all/test_package/conanfile.py b/conan-recipes/from-source/all/test_package/conanfile.py index 291d7d744..4a547e06a 100644 --- a/conan-recipes/from-source/all/test_package/conanfile.py +++ b/conan-recipes/from-source/all/test_package/conanfile.py @@ -9,6 +9,9 @@ class ZenohCPackageTestConan(ConanFile): generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" test_type = "explicit" + def build_requirements(self): + self.tool_requires("cmake/[>=3.16 <4]") + def requirements(self): self.requires(self.tested_reference_str)