This is an automated email from the ASF dual-hosted git repository.

pengzheng pushed a commit to branch hotfix/conan-private-dep
in repository https://gitbox.apache.org/repos/asf/celix.git


The following commit(s) were added to refs/heads/hotfix/conan-private-dep by 
this push:
     new 1db9b858 Fix copy error in generate method.
1db9b858 is described below

commit 1db9b858fe924e87e0290d812062636a14cd5c17
Author: PengZheng <[email protected]>
AuthorDate: Wed Mar 6 19:16:52 2024 +0800

    Fix copy error in generate method.
---
 conanfile.py                                | 6 ++++--
 examples/conan_test_package/conanfile.py    | 5 ++++-
 examples/conan_test_package_v2/conanfile.py | 6 ++++--
 3 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/conanfile.py b/conanfile.py
index e1b8003b..5fe1424c 100644
--- a/conanfile.py
+++ b/conanfile.py
@@ -345,8 +345,10 @@ class CelixConan(ConanFile):
         # tc.cache_variables["CMAKE_PROJECT_Celix_INCLUDE"] = 
os.path.join(self.build_folder, "conan_paths.cmake")
         # the following is workaround for 
https://github.com/conan-io/conan/issues/7192
         for dep in self.dependencies.host.values():
-            copy(self, "*.dylib", dep.cpp_info.libdir, 
os.path.join(self.build_folder, "lib"))
-            copy(self, "*.so*", dep.cpp_info.libdir, 
os.path.join(self.build_folder, "lib"))
+            if self.settings.os == "Linux":
+                copy(self, "*.so*", dep.cpp_info.libdir, 
os.path.join(self.build_folder, "lib"))
+            elif self.settings.os == "Macos":
+                copy(self, "*.dylib", dep.cpp_info.libdir, 
os.path.join(self.build_folder, "lib"))
         tc.cache_variables["CMAKE_BUILD_RPATH"] = 
os.path.join(self.build_folder, "lib")
         v = Version(self.version)
         tc.cache_variables["CELIX_MAJOR"] = str(v.major.value)
diff --git a/examples/conan_test_package/conanfile.py 
b/examples/conan_test_package/conanfile.py
index 2fd75fbc..9fb0648b 100644
--- a/examples/conan_test_package/conanfile.py
+++ b/examples/conan_test_package/conanfile.py
@@ -25,7 +25,10 @@ class TestPackageConan(ConanFile):
     # requires = "celix/2.3.0@docker/test"
 
     def imports(self):
-        self.copy("*", src="@libdirs", dst="lib")
+        if self.settings.os == "Linux":
+            self.copy("*.so*", src="@libdirs", dst="lib")
+        elif self.settings.os == "Macos":
+            self.copy("*.dylib", src="@libdirs", dst="lib")
 
     def build(self):
         cmake = CMake(self)
diff --git a/examples/conan_test_package_v2/conanfile.py 
b/examples/conan_test_package_v2/conanfile.py
index 3906d3f0..5241122f 100644
--- a/examples/conan_test_package_v2/conanfile.py
+++ b/examples/conan_test_package_v2/conanfile.py
@@ -67,8 +67,10 @@ class TestPackageConan(ConanFile):
         tc.cache_variables["TEST_COMPONENTS_READY_CHECK"] = 
celix_options.build_components_ready_check
         # the following is workaround 
https://github.com/conan-io/conan/issues/7192
         for dep in self.dependencies.host.values():
-            copy(self, "*.dylib", dep.cpp_info.libdir, 
os.path.join(self.build_folder, "lib"))
-            copy(self, "*.so*", dep.cpp_info.libdir, 
os.path.join(self.build_folder, "lib"))
+            if self.settings.os == "Linux":
+                copy(self, "*.so*", dep.cpp_info.libdir, 
os.path.join(self.build_folder, "lib"))
+            elif self.settings.os == "Macos":
+                copy(self, "*.dylib", dep.cpp_info.libdir, 
os.path.join(self.build_folder, "lib"))
         tc.cache_variables["CMAKE_BUILD_RPATH"] = 
os.path.join(self.build_folder, "lib")
         tc.user_presets_path = False
         tc.generate()

Reply via email to