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 0690fc7
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions recipes/ogre/1.x/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,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 +536,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 +549,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 +588,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 0690fc7

Please sign in to comment.