From aa287b29bd80a1e236c3634b747427f451cfcb26 Mon Sep 17 00:00:00 2001 From: Edgar Date: Sat, 22 Oct 2022 08:59:47 +0000 Subject: [PATCH] :wrench: Added support for building ogre3d-caelum with conan v2 --- ogre-caelum/all/conandata.yml | 14 ++---------- ogre-caelum/all/conanfile.py | 42 +++++++++++++++++++++++++---------- 2 files changed, 32 insertions(+), 24 deletions(-) diff --git a/ogre-caelum/all/conandata.yml b/ogre-caelum/all/conandata.yml index 1a043c7..69ac9d0 100644 --- a/ogre-caelum/all/conandata.yml +++ b/ogre-caelum/all/conandata.yml @@ -3,15 +3,5 @@ sources: url: "https://github.com/OGRECave/ogre-caelum/archive/94913d2040a41148c14001c33a0bdc0f100842f8.zip" sha256: "9de4159ae8050fd0858b3c1c09005aa50b36079a3a06accfb67203669be9a09e" "0.6.4": - url: "https://github.com/OGRECave/ogre-caelum/archive/7763bff99f758bbfcc5e7f9d751b2551e975545b.zip" - sha256: "069050b1039194324b0d1dddef887e83442b04d5843b4572ae5035da3e2d1ef6" -patches: - "0.6.3": - - patch_file: "patches/0.6.3/CMakeLists.txt.patch" - "0.6.4": - - patch_file: "patches/0.6.4/CMakeLists.txt.patch" -requirements: - "0.6.3": - - "ogre3d/[1.x]@anotherfoxguy/stable" - "0.6.4": - - "ogre3d/[13.x]@anotherfoxguy/stable" \ No newline at end of file + url: "https://github.com/OGRECave/ogre-caelum/archive/4bd1b0581d55896d37922483981582661ca557de.zip" + sha256: "deffe26ba169d89954f62ade50e856fdae293078c73836378d7bf3051eff0a8d" \ No newline at end of file diff --git a/ogre-caelum/all/conanfile.py b/ogre-caelum/all/conanfile.py index c40f95c..d4cdd09 100644 --- a/ogre-caelum/all/conanfile.py +++ b/ogre-caelum/all/conanfile.py @@ -1,25 +1,40 @@ -from conans import ConanFile, CMake, tools - +from conan import ConanFile +from conan.tools.files import get, collect_libs, replace_in_file +from conan.tools.cmake import CMakeToolchain, CMake, CMakeDeps, cmake_layout +import os class CaelumConan(ConanFile): name = "ogre3d-caelum" license = "GNU Lesser General Public License v2.1" url = "https://github.com/RigsOfRods/Caelum/issues" - description = "Caelum is a library which provides cross-platform socket abstraction" + description = "Library for rendering of dynamic and realistic skies" settings = "os", "compiler", "build_type", "arch" - generators = "cmake_find_package" - exports_sources = "patches/**" + + def layout(self): + cmake_layout(self) def requirements(self): - for req in self.conan_data["requirements"][self.version]: - self.requires(req) + self.requires("ogre3d/[13.x]@test/test") + self.requires("libpng/1.6.38") def source(self): - tools.get(**self.conan_data["sources"][self.version], strip_root=True) - for patch in self.conan_data["patches"][self.version]: - tools.patch(**patch) + get(self, **self.conan_data["sources"][self.version], strip_root=True) + + def generate(self): + tc = CMakeToolchain(self) + tc.generate() + deps = CMakeDeps(self) + deps.generate() + + def _patch_sources(self): + replace_in_file(self, + os.path.join(self.source_folder, "main/CMakeLists.txt"), + "OgreMain", + "OGRE::OGRE", + ) def build(self): + self._patch_sources() cmake = CMake(self) cmake.configure() cmake.build() @@ -29,12 +44,15 @@ class CaelumConan(ConanFile): cmake.install() def package_info(self): - self.cpp_info.name = "Caelum" + self.cpp_info.set_property("cmake_module_file_name", "Caelum") + self.cpp_info.set_property("cmake_module_target_name", "Caelum::Caelum") + self.cpp_info.set_property("cmake_file_name", "Caelum") + self.cpp_info.set_property("cmake_target_name", "Caelum::Caelum") self.cpp_info.includedirs = [ 'include', 'include/Caelum' ] - self.cpp_info.libs = tools.collect_libs(self) + self.cpp_info.libs = collect_libs(self) def package_id(self): self.info.requires["ogre3d"].full_recipe_mode()