From 391d3fdadcd394044402d8106a8895e1f0ae4a7e Mon Sep 17 00:00:00 2001 From: Martin Valgur Date: Sun, 12 Nov 2023 14:42:06 +0200 Subject: [PATCH] ogre: migrate to Conan v2 --- recipes/ogre/1.x/CMakeLists.txt | 2 -- recipes/ogre/1.x/conanfile.py | 23 +++++++++++++++++++---- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/recipes/ogre/1.x/CMakeLists.txt b/recipes/ogre/1.x/CMakeLists.txt index ba37ee873931c8..093f5dd1109280 100644 --- a/recipes/ogre/1.x/CMakeLists.txt +++ b/recipes/ogre/1.x/CMakeLists.txt @@ -12,8 +12,6 @@ find_package(OPENEXR QUIET CONFIG) find_package(FREETYPE QUIET CONFIG) find_package(assimp QUIET CONFIG) -add_library(pugixml ALIAS pugixml::pugixml) - add_subdirectory(src) if(TARGET Codec_FreeImage) diff --git a/recipes/ogre/1.x/conanfile.py b/recipes/ogre/1.x/conanfile.py index 94afb82adccf31..d44c91cb11fc4f 100644 --- a/recipes/ogre/1.x/conanfile.py +++ b/recipes/ogre/1.x/conanfile.py @@ -259,9 +259,10 @@ def layout(self): def requirements(self): self.requires("pugixml/1.13") - self.requires("sdl/2.28.3") self.requires("zlib/[>=1.2.11 <2]") self.requires("zziplib/0.13.72") + if self.options.get_safe("build_component_bites") or self.options.get_safe("build_rendersystem_tiny"): + self.requires("sdl/2.28.3") if self._build_opengl: self.requires("libglvnd/1.7.0", transitive_headers=True, transitive_libs=True) if self.settings.os in ["Linux", "FreeBSD"]: @@ -478,6 +479,15 @@ def _format_lib(self, lib): lib += "_d" return lib + @property + def _shared_extension(self): + if self.settings.os == "Windows": + return ".dll" + elif is_apple_os(self): + return ".dylib" + else: + return ".so" + def package_info(self): self.cpp_info.set_property("cmake_file_name", "OGRE") self.cpp_info.set_property("cmake_target_name", "OGRE::OGRE") @@ -527,7 +537,8 @@ def _add_plugin_component(comp, *, requires=None, extra_libs=None): comp, cmake_target=None, pkg_config_name=None, - libs=[comp] + (extra_libs or []), + # Adding the extension for a full name since the plugin libs don't include the standard 'lib' prefix + libs=[comp + self._shared_extension] + (extra_libs or []), libdirs=[plugin_lib_dir], includedirs=["include", include_prefix, os.path.join(include_prefix, "Plugins", dirname)], requires=requires, @@ -539,7 +550,7 @@ def _add_rendersystem_component(comp, *, requires=None, extra_libs=None): comp, cmake_target=None, pkg_config_name=None, - libs=[comp] + (extra_libs or []), + libs=[comp + self._shared_extension] + (extra_libs or []), libdirs=[plugin_lib_dir], includedirs=["include", include_prefix, os.path.join(include_prefix, "RenderSystems", dirname)], requires=requires, @@ -578,8 +589,12 @@ def _add_rendersystem_component(comp, *, requires=None, extra_libs=None): _add_core_component("Terrain") if self.options.build_component_volume: _add_core_component("Volume") + if self._build_opengl: - _add_core_component("GLSupport", requires=["libglvnd::libglvnd"]) + if not self.options.shared: + _add_core_component("GLSupport", requires=["libglvnd::libglvnd"]) + else: + self.cpp_info.components["OgreMain"].requires.append("libglvnd::libglvnd") if self.options.build_plugin_assimp: _add_plugin_component("Codec_Assimp", requires=["assimp::assimp"])