Skip to content

Commit

Permalink
ogre: migrate to Conan v2
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Nov 12, 2023
1 parent e58f1dd commit f19de90
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions recipes/ogre/1.x/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]:
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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"])
Expand Down

0 comments on commit f19de90

Please sign in to comment.