Compare commits

...

34 Commits

Author SHA1 Message Date
f1c3a2dc15
🐛 Fixed compatibility with Conan 2.0 2023-03-16 11:26:56 +01:00
91a339e086
🐛 Fixed SocketW target name 2023-02-10 14:33:00 +01:00
47f39a851b
⬆️ Updated OGRE to 13.6.2 2023-02-08 13:14:11 +01:00
0bd0d9b2ba
⬆️ Updated OGRE to 13.6.0 2023-01-23 11:40:48 +01:00
8d943b199e
⬆️ Updated OGRE to 13.6.0 2023-01-13 20:28:26 +01:00
b8ed6c8f6c
🎉 Added mygui-next 2023-01-07 14:40:44 +01:00
cbe26696c0
🎉 Made tools a conan pkg 2023-01-06 11:26:40 +01:00
5323a66b9d
🔧 Disabled ogre bullet component
Needs to be fixed
2022-12-26 15:56:42 +01:00
696469c49a
⬆️ Updated OGRE to 13.5.3 2022-11-25 16:23:25 +01:00
2cd2651c10
⬆️ Updated OGRE to 13.5.2 2022-11-25 16:18:35 +01:00
b8b001ebb6
👷 Disabled gh-actions 2022-11-14 19:02:50 +01:00
87bf56d70a
🔧 Added special caelum 2022-11-14 18:37:33 +01:00
7026ce1c40
🐛 Fixed caelum patch 2022-11-14 18:17:03 +01:00
da749af80e
🐛 Fixed ogre 1.11 build with conan V2 2022-11-14 18:16:38 +01:00
48367f6c6b
🔧 Update ogre-next to 2022.10 2022-11-09 13:36:03 +01:00
c45516ad8e
🎉 Added OGRE 2.3 2022-11-09 09:56:45 +01:00
06c8dbc79b ⬆️ Updated OGRE to 13.5.1 2022-11-06 17:52:41 +00:00
4ab521cf9f
⬆️ Updated ogre 13.5.0 2022-10-30 14:39:56 +01:00
2fbd9faa87
🐛 Fixed ogre version 2022-10-30 14:38:39 +01:00
cab77497c1
🔧 Added support for building MyGUI with conan v2 2022-10-30 14:38:15 +01:00
9761196edf
🐛 Fixed missing config for discord-rpc 2022-10-28 13:02:24 +02:00
ad2652a1bd
⬆️ Updated pagedgeometry and caelum 2022-10-28 12:54:18 +02:00
17899a42a5
🔧 Added support for building directx-sdk with conan v2 2022-10-28 12:53:13 +02:00
37ff0b9b72
🐛 Fixed missing files 2022-10-28 11:21:11 +02:00
d5d53de9ef
🎉 Added directx-sdk 2022-10-28 11:21:01 +02:00
aa287b29bd 🔧 Added support for building ogre3d-caelum with conan v2 2022-10-22 08:59:47 +00:00
9d5ccfa930 🐛 Fixed ogre3d-pagedgeometry cmake targets 2022-10-22 08:50:52 +00:00
4e33343447 🔧 Added support for building ogre3d-pagedgeometry with conan v2 2022-10-22 08:46:52 +00:00
75e7c121b4 🐛 Fixed ogre3d cmake targets 2022-10-22 08:45:53 +00:00
46e4195d1a 🔧 Added support for building ogre3d with conan v2 2022-10-21 12:10:09 +00:00
7e4f63f99e
🔧 Added support for building cg-toolkit with conan v2 2022-10-21 11:41:46 +02:00
c33b6099f1
🔧 Added support for building discord-rpc with conan v2 2022-10-21 11:32:50 +02:00
bc5a94aa3d
🔧 Added support for building ois with conan v2 2022-10-21 11:25:53 +02:00
87a934a722
🔧 Added support for building socketw with conan v2 2022-10-15 13:07:30 +02:00
61 changed files with 1261 additions and 445 deletions

4
.gitignore vendored
View File

@ -2,4 +2,6 @@ build/
tmp/
upload.*
.idea/
build_tmp.py
build_tmp.py
__pycache__
conanfile-old.py

View File

@ -1,6 +1,6 @@
from conans import ConanFile, tools
from conans.tools import os_info
from conan import ConanFile
from conan.tools.files import get, collect_libs, copy
import os
class GcConan(ConanFile):
name = "cg-toolkit"
@ -9,23 +9,26 @@ class GcConan(ConanFile):
settings = "os", "arch"
def source(self):
tools.get(**self.conan_data["sources"][self.version], strip_root=True)
get(self, **self.conan_data["sources"][self.version], strip_root=True)
def package(self):
self.copy("*.h", src="include", dst="include")
if os_info.is_linux:
if self.settings.arch.__contains__('64'):
self.copy("*.so", src="lib64", dst="lib", keep_path=False)
copy(self, "*.h", os.path.join(self.source_folder, "include"), os.path.join(self.package_folder,"include"))
if self.settings.os == "Windows":
if '64' in self.settings.arch:
#copy(self, "*.h", self.source_folder, os.path.join(self.package_folder, "include"))
copy(self, "*.lib", os.path.join(self.source_folder, "lib64"), os.path.join(self.package_folder,"lib"))
copy(self, "*.dll", os.path.join(self.source_folder, "bin64"), os.path.join(self.package_folder,"bin"))
else:
self.copy("*.so", src="lib", dst="lib", keep_path=False)
copy(self, "*.lib", os.path.join(self.source_folder, "lib"), os.path.join(self.package_folder,"lib"))
copy(self, "*.dll", os.path.join(self.source_folder, "bin"), os.path.join(self.package_folder,"bin"))
else:
if self.settings.arch.__contains__('64'):
self.copy("*.lib", src="lib64", dst="lib", keep_path=False)
self.copy("*.dll", src="bin64", dst="bin", keep_path=False)
if '64' in self.settings.arch:
copy(self, "*.so", os.path.join(self.source_folder, "lib64"), os.path.join(self.package_folder,"lib"))
else:
self.copy("*.lib", src="lib", dst="lib", keep_path=False)
self.copy("*.dll", src="bin", dst="bin", keep_path=False)
def package_info(self):
self.cpp_info.name = "Cg"
self.cpp_info.libs = tools.collect_libs(self)
copy(self, "*.so", os.path.join(self.source_folder, "lib"), os.path.join(self.package_folder,"lib"))
def package_info(self):
self.cpp_info.set_property("cmake_module_file_name", "Cg")
self.cpp_info.set_property("cmake_module_target_name", "Cg::Cg")
self.cpp_info.set_property("cmake_file_name", "Cg")
self.cpp_info.set_property("cmake_target_name", "Cg::Cg")
self.cpp_info.libs = collect_libs(self)

View File

@ -0,0 +1,4 @@
sources:
"9.0":
url: "https://cdn.anotherfoxguy.com/DirectX-SDK.zip"
sha256: "f73f10c4519f445e1ecc71bcc315c3c9da90f08bacf354e1b3fabba1bacef77d"

View File

@ -0,0 +1,23 @@
from conan import ConanFile
from conan.tools.files import get, copy
import os
class DxConan(ConanFile):
name = "directx-sdk"
version = "9.0"
author = "Edgar Edgar@AnotherFoxGuy.com"
settings = "os", "arch"
def source(self):
get(self, **self.conan_data["sources"][self.version])
def package(self):
copy(self, "*", os.path.join(self.source_folder, "Include"), os.path.join(self.package_folder, "include"))
if '64' in self.settings.arch:
copy(self, "*", os.path.join(self.source_folder, "Lib/x64"), os.path.join(self.package_folder, "lib"), keep_path=False)
else:
copy(self, "*", os.path.join(self.source_folder, "lib/x86"), os.path.join(self.package_folder, "lib"), keep_path=False)
def package_info(self):
self.cpp_info.set_property("cmake_file_name", "DirectX9")
self.cpp_info.libs = ["d3d9", "d3dx9", "dxguid"]

3
directx-sdk/config.yml Normal file
View File

@ -0,0 +1,3 @@
versions:
"9.0":
folder: all

View File

@ -1,4 +1,6 @@
from conans import ConanFile, CMake, tools
from conan import ConanFile
from conan.tools.files import get, collect_libs
from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout
class DiscordrpcConan(ConanFile):
@ -9,12 +11,19 @@ class DiscordrpcConan(ConanFile):
description = "This is a library for interfacing your game with a locally running Discord desktop client. It's known to work on Windows, macOS, and Linux."
settings = "os", "compiler", "build_type", "arch"
def layout(self):
cmake_layout(self)
def source(self):
tools.get(**self.conan_data["sources"][self.version], strip_root=True)
get(self, **self.conan_data["sources"][self.version], strip_root=True)
def generate(self):
tc = CMakeToolchain(self)
tc.variables["BUILD_EXAMPLES"] = "OFF"
tc.generate()
def build(self):
cmake = CMake(self)
cmake.definitions['BUILD_EXAMPLES'] = 'OFF'
cmake.configure()
cmake.build()
@ -23,4 +32,4 @@ class DiscordrpcConan(ConanFile):
cmake.install()
def package_info(self):
self.cpp_info.libs = tools.collect_libs(self)
self.cpp_info.libs = collect_libs(self)

3
discord-rpc/config.yml Normal file
View File

@ -0,0 +1,3 @@
versions:
"3.4.0":
folder: all

0
linter/__init__.py Normal file
View File

View File

@ -0,0 +1,28 @@
from pylint.checkers import BaseChecker
from pylint.interfaces import IAstroidChecker
from astroid import nodes, Const, AssignName
class ImportConanFile(BaseChecker):
"""
Import ConanFile from new 'conan' module
"""
__implements__ = IAstroidChecker
name = "conan-import-conanfile"
msgs = {
"E9006": (
"Import ConanFile from new module: `from conan import ConanFile`. Old import is deprecated in Conan v2.",
"conan-import-conanfile",
"Import ConanFile from new module: `from conan import ConanFile`. Old import is deprecated in Conan v2.",
),
}
def visit_importfrom(self, node: nodes.ImportFrom) -> None:
basename = node.modname
if basename == 'conans':
names = [name for name, _ in node.names]
if 'ConanFile' in names:
self.add_message("conan-import-conanfile", node=node)

View File

@ -0,0 +1,77 @@
from pylint.checkers import BaseChecker
from pylint.interfaces import IAstroidChecker
from astroid import nodes, Const, AssignName
class ImportErrors(BaseChecker):
"""
Import errors from new 'conan' module
"""
__implements__ = IAstroidChecker
name = "conan-import-errors"
msgs = {
"E9008": (
"Import errors from new module: `from conan import errors`. Old import is deprecated in Conan v2.",
"conan-import-errors",
"Import errors from new module: `from conan import errors`. Old import is deprecated in Conan v2.",
),
}
def visit_importfrom(self, node: nodes.ImportFrom) -> None:
basename = node.modname
if basename == 'conans':
names = [name for name, _ in node.names]
if 'errors' in names:
self.add_message("conan-import-errors", node=node)
class ImportErrorsConanException(BaseChecker):
"""
Import errors from new 'conan' module
"""
__implements__ = IAstroidChecker
name = "conan-import-error-conanexception"
msgs = {
"E9009": (
"Import ConanException from new module: `from conan.errors import ConanException`. Old import is deprecated in Conan v2.",
"conan-import-error-conanexception",
"Import ConanException from new module: `from conan.errors import ConanException`. Old import is deprecated in Conan v2.",
),
}
def visit_importfrom(self, node: nodes.ImportFrom) -> None:
basename = node.modname
if basename == 'conans.errors':
names = [name for name, _ in node.names]
if 'ConanException' in names:
self.add_message("conan-import-error-conanexception", node=node)
class ImportErrorsConanInvalidConfiguration(BaseChecker):
"""
Import errors from new 'conan' module
"""
__implements__ = IAstroidChecker
name = "conan-import-error-conaninvalidconfiguration"
msgs = {
"E9010": (
"Import ConanInvalidConfiguration from new module: `from conan.errors import ConanInvalidConfiguration`. Old import is deprecated in Conan v2.",
"conan-import-error-conaninvalidconfiguration",
"Import ConanInvalidConfiguration from new module: `from conan.errors import ConanInvalidConfiguration`. Old import is deprecated in Conan v2.",
),
}
def visit_importfrom(self, node: nodes.ImportFrom) -> None:
basename = node.modname
if basename == 'conans.errors':
names = [name for name, _ in node.names]
if 'ConanInvalidConfiguration' in names:
self.add_message("conan-import-error-conaninvalidconfiguration", node=node)

View File

@ -0,0 +1,30 @@
import re
from email.mime import base
from pylint.checkers import BaseChecker
from pylint.interfaces import IAstroidChecker
from astroid import nodes, Const, AssignName
class ImportTools(BaseChecker):
"""
Import tools following pattern 'from conan.tools.xxxx import yyyyy'
"""
__implements__ = IAstroidChecker
name = "conan-import-tools"
msgs = {
"E9011": (
"Import tools following pattern 'from conan.tools.xxxx import yyyyy' (https://docs.conan.io/en/latest/reference/conanfile/tools.html).",
"conan-import-tools",
"Import tools following pattern 'from conan.tools.xxxx import yyyyy' (https://docs.conan.io/en/latest/reference/conanfile/tools.html).",
),
}
def visit_importfrom(self, node: nodes.ImportFrom) -> None:
basename = node.modname
names = [name for name, _ in node.names]
if basename == 'conan' and 'tools' in names:
self.add_message("conan-import-tools", node=node)
elif re.match(r'conan\.tools\.[^.]+\..+', basename):
self.add_message("conan-import-tools", node=node)

View File

@ -0,0 +1,30 @@
from pylint.checkers import BaseChecker
from pylint.interfaces import IAstroidChecker
from astroid import nodes, Const, AssignName
class NoPackageName(BaseChecker):
"""
Conanfile used for testing a package should NOT provide a name
"""
__implements__ = IAstroidChecker
name = "conan-test-package-name"
msgs = {
"E9007": (
"No 'name' attribute in test_package conanfile",
"conan-test-no-name",
"No 'name' attribute in test_package conanfile."
)
}
def visit_classdef(self, node: nodes) -> None:
if node.basenames == ['ConanFile']:
for attr in node.body:
children = list(attr.get_children())
if len(children) == 2 and \
isinstance(children[0], AssignName) and \
children[0].name == "name" and \
isinstance(children[1], Const):
self.add_message("conan-test-no-name", node=attr, line=attr.lineno)

View File

@ -0,0 +1,39 @@
from pylint.checkers import BaseChecker
from pylint.interfaces import IAstroidChecker
from astroid import nodes, Const, AssignName
class PackageName(BaseChecker):
"""
All packages must have a lower-case name
"""
__implements__ = IAstroidChecker
name = "conan-package-name"
msgs = {
"E9004": (
"Reference name should be all lowercase",
"conan-bad-name",
"Use only lower-case on the package name: `name = 'foobar'`."
),
"E9005": (
"Missing name attribute",
"conan-missing-name",
"The member attribute `name` must be declared: `name = 'foobar'`."
)
}
def visit_classdef(self, node: nodes) -> None:
if node.basenames == ['ConanFile']:
for attr in node.body:
children = list(attr.get_children())
if len(children) == 2 and \
isinstance(children[0], AssignName) and \
children[0].name == "name" and \
isinstance(children[1], Const):
value = children[1].as_string()
if value.lower() != value:
self.add_message("conan-bad-name", node=attr, line=attr.lineno)
return
self.add_message("conan-missing-name", node=node)

View File

@ -0,0 +1,20 @@
"""
Pylint plugin/rules for test_package folder in Conan Center Index
"""
from pylint.lint import PyLinter
from linter.check_import_conanfile import ImportConanFile
from linter.check_no_test_package_name import NoPackageName
from linter.check_import_errors import ImportErrorsConanException, ImportErrorsConanInvalidConfiguration, ImportErrors
from linter.check_import_tools import ImportTools
def register(linter: PyLinter) -> None:
linter.register_checker(NoPackageName(linter))
linter.register_checker(ImportConanFile(linter))
linter.register_checker(ImportErrors(linter))
linter.register_checker(ImportErrorsConanException(linter))
linter.register_checker(ImportErrorsConanInvalidConfiguration(linter))
linter.register_checker(ImportTools(linter))

View File

@ -0,0 +1,20 @@
"""
Pylint plugin/rules for conanfiles in Conan Center Index
"""
from pylint.lint import PyLinter
from linter.check_package_name import PackageName
from linter.check_import_conanfile import ImportConanFile
from linter.check_import_errors import ImportErrorsConanException, ImportErrorsConanInvalidConfiguration, ImportErrors
from linter.check_import_tools import ImportTools
def register(linter: PyLinter) -> None:
linter.register_checker(PackageName(linter))
linter.register_checker(ImportConanFile(linter))
linter.register_checker(ImportErrors(linter))
linter.register_checker(ImportErrorsConanException(linter))
linter.register_checker(ImportErrorsConanInvalidConfiguration(linter))
linter.register_checker(ImportTools(linter))

30
linter/pylintrc_recipe Normal file
View File

@ -0,0 +1,30 @@
[MASTER]
load-plugins=linter.conanv2_transition,
linter.transform_conanfile,
linter.transform_imports
py-version=3.6
recursive=no
suggestion-mode=yes
unsafe-load-any-extension=no
[MESSAGES CONTROL]
disable=fixme,
line-too-long,
missing-module-docstring,
missing-function-docstring,
missing-class-docstring,
invalid-name,
wrong-import-order, # TODO: Remove
import-outside-toplevel # TODO: Remove
enable=conan-bad-name,
conan-missing-name,
conan-import-conanfile
[REPORTS]
evaluation=max(0, 0 if fatal else 10.0 - ((float(5 * error) / statement) * 10))
output-format=text
reports=no
score=no

View File

@ -0,0 +1,27 @@
[MASTER]
load-plugins=linter.conanv2_test_transition,
linter.transform_conanfile,
linter.transform_imports
py-version=3.6
recursive=no
suggestion-mode=yes
unsafe-load-any-extension=no
[MESSAGES CONTROL]
disable=fixme,
line-too-long,
missing-module-docstring,
missing-function-docstring,
missing-class-docstring,
invalid-name,
wrong-import-order, # TODO: Remove
import-outside-toplevel # TODO: Remove
enable=conan-test-no-name,
conan-import-conanfile
[REPORTS]
evaluation=max(0, 0 if fatal else 10.0 - ((float(5 * error) / statement) * 10))
output-format=text
reports=no
score=no

43
linter/recipe_linter.json Normal file
View File

@ -0,0 +1,43 @@
{
"problemMatcher": [
{
"owner": "recipe_linter_fatals",
"severity": "error",
"pattern": [
{
"regexp": "(\\S+):(\\d+): \\[(F\\d+\\(\\S+\\)),\\s(.+?)?\\](.+)",
"file": 1,
"line": 2,
"message": 5,
"code": 3
}
]
},
{
"owner": "recipe_linter_errors",
"severity": "error",
"pattern": [
{
"regexp": "(\\S+):(\\d+): \\[(E\\d+\\(\\S+\\)),\\s(.+?)?\\](.+)",
"file": 1,
"line": 2,
"message": 5,
"code": 3
}
]
},
{
"owner": "recipe_linter_warnings",
"severity": "warning",
"pattern": [
{
"regexp": "(\\S+):(\\d+): \\[(W\\d+\\(\\S+\\)),\\s(.+?)?\\](.+)",
"file": 1,
"line": 2,
"message": 5,
"code": 3
}
]
}
]
}

View File

@ -0,0 +1,74 @@
# Class ConanFile doesn't declare all the valid members and functions,
# some are injected by Conan dynamically to the class.
import textwrap
import astroid
from astroid.builder import AstroidBuilder
from astroid.manager import AstroidManager
def _settings_transform():
module = AstroidBuilder(AstroidManager()).string_build(
textwrap.dedent("""
class Settings(object):
os = None
arch = None
compiler = None
build_type = None
""")
)
return module['Settings']
def _user_info_build_transform():
module = AstroidBuilder(AstroidManager()).string_build(
textwrap.dedent("""
class UserInfoBuild(defaultdict):
pass
""")
)
return module['UserInfoBuild']
def register(_):
pass
def transform_conanfile(node):
"""Transform definition of ConanFile class so dynamic fields are visible to pylint"""
str_class = astroid.builtin_lookup("str")
dict_class = astroid.builtin_lookup("dict")
info_class = astroid.MANAGER.ast_from_module_name("conans.model.info").lookup(
"ConanInfo")
build_requires_class = astroid.MANAGER.ast_from_module_name(
"conans.client.graph.graph_manager").lookup("_RecipeBuildRequires")
file_copier_class = astroid.MANAGER.ast_from_module_name(
"conans.client.file_copier").lookup("FileCopier")
file_importer_class = astroid.MANAGER.ast_from_module_name(
"conans.client.importer").lookup("_FileImporter")
python_requires_class = astroid.MANAGER.ast_from_module_name(
"conans.client.graph.python_requires").lookup("PyRequires")
dynamic_fields = {
"conan_data": str_class,
"build_requires": build_requires_class,
"tool_requires": build_requires_class,
"info_build": info_class,
"user_info_build": [_user_info_build_transform()],
"info": info_class,
"copy": file_copier_class,
"copy_deps": file_importer_class,
"python_requires": [str_class, python_requires_class],
"recipe_folder": str_class,
"settings_build": [_settings_transform()],
"settings_target": [_settings_transform()],
"conf": dict_class,
}
for f, t in dynamic_fields.items():
node.locals[f] = [i for i in t]
astroid.MANAGER.register_transform(
astroid.ClassDef, transform_conanfile,
lambda node: node.qname() == "conans.model.conan_file.ConanFile")

View File

@ -0,0 +1,46 @@
import astroid
from pylint.lint import PyLinter
"""
Here we are transforming the imports to mimic future Conan v2 release. With
these changes, built-in checks in Pylint will raise with different errors, so
we are modifying the messages to point users in the right direction.
"""
def register(linter: PyLinter):
msge1101 = linter.msgs_store._messages_definitions["E1101"]
msge1101.msg += ". Please, check https://github.com/conan-io/conan-center-index/blob/master/docs/v2_linter.md"
linter.msgs_store.register_message(msge1101)
msge0611 = linter.msgs_store._messages_definitions["E0611"]
msge0611.msg += ". Please, check https://github.com/conan-io/conan-center-index/blob/master/docs/v2_linter.md"
linter.msgs_store.register_message(msge0611)
def transform_tools(module):
""" Transform import module """
if 'get' in module.locals:
del module.locals['get']
if 'cross_building' in module.locals:
del module.locals['cross_building']
if 'rmdir' in module.locals:
del module.locals['rmdir']
if 'Version' in module.locals:
del module.locals['Version']
def transform_errors(module):
pass
#if 'ConanInvalidConfiguration' in module.locals:
# del module.locals['ConanInvalidConfiguration']
#if 'ConanException' in module.locals:
# del module.locals['ConanException']
astroid.MANAGER.register_transform(
astroid.Module, transform_tools,
lambda node: node.qname() == "conans.tools")
astroid.MANAGER.register_transform(
astroid.Module, transform_errors,
lambda node: node.qname() == "conans.errors")

26
linter/yamllint_rules.yml Normal file
View File

@ -0,0 +1,26 @@
extends: default
rules:
document-start:
level: error
present: false
document-end:
level: error
present: false
empty-values:
forbid-in-block-mappings: true
forbid-in-flow-mappings: true
line-length: disable
indentation:
level: error
new-line-at-end-of-file:
level: error
trailing-spaces:
level: error
comments:
level: error
comments-indentation:
level: error
new-lines:
type: unix
key-duplicates:
level: error

View File

@ -4,13 +4,4 @@ sources:
sha256: "d1d5f294670ae71f7200ed4b30859018281d8cfd45d6a38d18b97a4aba604c42"
"3.4.1":
url: "https://github.com/MyGUI/mygui/archive/refs/tags/MyGUI3.4.1.tar.gz"
sha256: "bdf730bdeb4ad89e6b8223967db01aa5274d2b93adc2c0d6aa4842faeed4de1a"
patches:
"3.4.0":
- patch_file: "patches/3.4.0/CMakeLists.txt.patch"
"3.4.1":
- patch_file: "patches/3.4.1/CMakeLists.txt.patch"
requirements:
- "ogre3d/[1.x]@anotherfoxguy/stable"
- "freetype/[2.x]"
- "zlib/[1.x]"
sha256: "bdf730bdeb4ad89e6b8223967db01aa5274d2b93adc2c0d6aa4842faeed4de1a"

View File

@ -1,5 +1,7 @@
from conans import ConanFile, CMake, tools
from conans.tools import os_info, SystemPackageTool
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 MyGUIConan(ConanFile):
@ -8,30 +10,49 @@ class MyGUIConan(ConanFile):
url = "https://github.com/AnotherFoxGuy/conan-MyGUI"
description = "Fast, flexible and simple GUI."
settings = "os", "compiler", "build_type", "arch"
generators = "cmake_paths", "cmake_find_package"
exports_sources = "patches/**"
options = {"system_ogre": [True, False]}
default_options = {"system_ogre": False}
def layout(self):
cmake_layout(self)
def requirements(self):
if not self.options.system_ogre:
for req in self.conan_data["requirements"]:
self.requires(req)
self.requires("ogre3d/[>=1 <14]@anotherfoxguy/stable")
def source(self):
tools.get(**self.conan_data["sources"][self.version], strip_root=True)
if not self.options.system_ogre:
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.variables["MYGUI_BUILD_DEMOS"] = "OFF"
tc.variables["MYGUI_BUILD_DOCS"] = "OFF"
tc.variables["MYGUI_BUILD_TEST_APP"] = "OFF"
tc.variables["MYGUI_BUILD_PLUGINS"] = "OFF"
tc.variables["MYGUI_BUILD_TOOLS"] = "OFF"
tc.variables["MYGUI_RENDERSYSTEM"] = "3"
tc.variables["OIS_BUILD_DEMOS"] = "OFF"
tc.variables["OIS_BUILD_DEMOS"] = "OFF"
tc.variables["OIS_BUILD_DEMOS"] = "OFF"
tc.generate()
deps = CMakeDeps(self)
deps.generate()
def _patch_sources(self):
replace_in_file(self,
os.path.join(self.source_folder, "MyGUIEngine/CMakeLists.txt"),
"${FREETYPE_LIBRARIES}",
"freetype",
)
replace_in_file(self,
os.path.join(self.source_folder, "Platforms/Ogre/OgrePlatform/CMakeLists.txt"),
"${OGRE_LIBRARIES}",
"OGRE::OGRE",
)
def build(self):
self._patch_sources()
cmake = CMake(self)
cmake.definitions['MYGUI_BUILD_DEMOS'] = 'OFF'
cmake.definitions['MYGUI_BUILD_DOCS'] = 'OFF'
cmake.definitions['MYGUI_BUILD_TEST_APP'] = 'OFF'
cmake.definitions['MYGUI_BUILD_PLUGINS'] = 'OFF'
cmake.definitions['MYGUI_BUILD_TOOLS'] = 'OFF'
cmake.definitions['MYGUI_RENDERSYSTEM'] = '3'
cmake.configure()
cmake.build()
@ -40,10 +61,14 @@ class MyGUIConan(ConanFile):
cmake.install()
def package_info(self):
self.cpp_info.set_property("cmake_module_file_name", "MyGUI")
self.cpp_info.set_property("cmake_module_target_name", "MyGUI::MyGUI")
self.cpp_info.set_property("cmake_file_name", "MyGUI")
self.cpp_info.set_property("cmake_target_name", "MyGUI::MyGUI")
self.cpp_info.includedirs = ['include/MYGUI']
# Directories where libraries can be found
self.cpp_info.libdirs = ['lib', f'lib/{self.settings.build_type}']
self.cpp_info.libs = tools.collect_libs(self)
self.cpp_info.libs = collect_libs(self)
def package_id(self):
if not self.options.system_ogre:

View File

@ -1,14 +0,0 @@
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -11,8 +11,11 @@
project(MYGUI)
+include(${CMAKE_BINARY_DIR}/conan_paths.cmake)
+
# Include necessary submodules
set(CMAKE_MODULE_PATH
+ "${CMAKE_BINARY_DIR}"
"${MYGUI_SOURCE_DIR}/CMake"
"${MYGUI_SOURCE_DIR}/CMake/Utils"
"${MYGUI_SOURCE_DIR}/CMake/Packages"

View File

@ -1,14 +0,0 @@
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -22,8 +22,11 @@
project(MYGUI)
+include(${CMAKE_BINARY_DIR}/conan_paths.cmake)
+
# Include necessary submodules
set(CMAKE_MODULE_PATH
+ "${CMAKE_BINARY_DIR}"
"${MYGUI_SOURCE_DIR}/CMake"
"${MYGUI_SOURCE_DIR}/CMake/Utils"
"${MYGUI_SOURCE_DIR}/CMake/Packages"

4
mygui/next/conandata.yml Normal file
View File

@ -0,0 +1,4 @@
sources:
"2022.10":
url: "https://github.com/cryham/mygui-next/archive/3f1194e5075078f0a9428b052f97749486b6fd72.tar.gz"
sha256: "13f084a95e9e22bbb1f1d216b55527fd03f4a4e525484e45b97f98ba307732a4"

83
mygui/next/conanfile.py Normal file
View File

@ -0,0 +1,83 @@
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 MyGUIConan(ConanFile):
name = "mygui-next"
license = "MIT"
url = "https://github.com/AnotherFoxGuy/conan-MyGUI"
description = "Fast, flexible and simple GUI."
settings = "os", "compiler", "build_type", "arch"
options = {"system_ogre": [True, False]}
default_options = {"system_ogre": False}
def layout(self):
cmake_layout(self)
def requirements(self):
if not self.options.system_ogre:
# self.requires("ogre3d-next/[2.x]@anotherfoxguy/stable")
self.requires("ogre3d-next/2023.01@anotherfoxguy/testing")
def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)
def generate(self):
tc = CMakeToolchain(self)
tc.variables["MYGUI_BUILD_DEMOS"] = "OFF"
tc.variables["MYGUI_BUILD_DOCS"] = "OFF"
tc.variables["MYGUI_BUILD_TEST_APP"] = "OFF"
tc.variables["MYGUI_BUILD_PLUGINS"] = "OFF"
tc.variables["MYGUI_BUILD_TOOLS"] = "OFF"
tc.variables["MYGUI_DONT_USE_OBSOLETE"] = "OFF"
tc.variables["MYGUI_USE_FREETYPE"] = "ON"
tc.variables["MYGUI_RENDERSYSTEM"] = "8"
tc.variables["OIS_BUILD_DEMOS"] = "OFF"
tc.variables["OIS_BUILD_DEMOS"] = "OFF"
tc.variables["OIS_BUILD_DEMOS"] = "OFF"
tc.generate()
deps = CMakeDeps(self)
deps.generate()
def _patch_sources(self):
replace_in_file(self,
os.path.join(self.source_folder, "MyGUIEngine/CMakeLists.txt"),
"${FREETYPE_LIBRARIES}",
"freetype",
)
replace_in_file(self,
os.path.join(self.source_folder, "CMakeLists.txt"),
"# Find dependencies",
"find_package(OGRE REQUIRED)",
)
replace_in_file(self,
os.path.join(self.source_folder, "Platforms/Ogre2/Ogre2Platform/CMakeLists.txt"),
"${OGRE_LIBRARIES}",
"OGRE::OGRE",
)
def build(self):
self._patch_sources()
cmake = CMake(self)
cmake.configure()
cmake.build()
def package(self):
cmake = CMake(self)
cmake.install()
def package_info(self):
self.cpp_info.set_property("cmake_module_file_name", "MyGUI")
self.cpp_info.set_property("cmake_module_target_name", "MyGUI::MyGUI")
self.cpp_info.set_property("cmake_file_name", "MyGUI")
self.cpp_info.set_property("cmake_target_name", "MyGUI::MyGUI")
self.cpp_info.includedirs = ['include/MYGUI']
# Directories where libraries can be found
self.cpp_info.libdirs = ['lib', f'lib/{self.settings.build_type}']
self.cpp_info.libs = collect_libs(self)
def package_id(self):
if not self.options.system_ogre:
self.info.requires["ogre3d-next"].full_recipe_mode()

View File

@ -2,16 +2,15 @@ sources:
"0.6.3":
url: "https://github.com/OGRECave/ogre-caelum/archive/94913d2040a41148c14001c33a0bdc0f100842f8.zip"
sha256: "9de4159ae8050fd0858b3c1c09005aa50b36079a3a06accfb67203669be9a09e"
"0.6.3.1":
url: "https://github.com/RigsOfRods/ogre-caelum/archive/70fcf62f306288c9472cc03a42367c9625c839ea.zip"
sha256: "b4b4b6fe2997c3da4537ada2ab69032647e65773886e57c9803fc90aac2dd158"
"0.6.4":
url: "https://github.com/OGRECave/ogre-caelum/archive/7763bff99f758bbfcc5e7f9d751b2551e975545b.zip"
sha256: "069050b1039194324b0d1dddef887e83442b04d5843b4572ae5035da3e2d1ef6"
url: "https://github.com/OGRECave/ogre-caelum/archive/4bd1b0581d55896d37922483981582661ca557de.zip"
sha256: "deffe26ba169d89954f62ade50e856fdae293078c73836378d7bf3051eff0a8d"
"2022.08":
url: "https://github.com/OGRECave/ogre-caelum/archive/4bd1b0581d55896d37922483981582661ca557de.zip"
sha256: "deffe26ba169d89954f62ade50e856fdae293078c73836378d7bf3051eff0a8d"
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"
"2022.08":
- patch_file: "patches/2022.08/CMakeLists.txt.patch"

View File

@ -1,25 +1,45 @@
from conans import ConanFile, CMake, tools
from conan import ConanFile
from conan.tools.files import (
get,
collect_libs,
apply_conandata_patches,
export_conandata_patches,
)
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 export_sources(self):
export_conandata_patches(self)
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]@anotherfoxguy/stable")
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):
apply_conandata_patches(self)
def build(self):
self._patch_sources()
cmake = CMake(self)
cmake.configure()
cmake.build()
@ -29,12 +49,12 @@ class CaelumConan(ConanFile):
cmake.install()
def package_info(self):
self.cpp_info.name = "Caelum"
self.cpp_info.includedirs = [
'include',
'include/Caelum'
]
self.cpp_info.libs = tools.collect_libs(self)
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 = collect_libs(self)
def package_id(self):
self.info.requires["ogre3d"].full_recipe_mode()

View File

@ -1,20 +0,0 @@
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -7,7 +7,7 @@
# cmake system for Caelum updated on 6-10-2017 by Edgar{at}AnotherFoxGuy{DOT}com
cmake_minimum_required(VERSION 3.0.2)
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake)
# add some functions we use that are shipped with cmake
@@ -34,7 +34,7 @@
SET(CMAKE_USE_RELATIVE_PATHS OFF)
-find_package(OGRE REQUIRED CONFIG)
+find_package(OGRE REQUIRED)
link_directories(${OGRE_LIBRARY_DIRS})
# setup paths

View File

@ -1,25 +0,0 @@
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -8,6 +8,8 @@
cmake_minimum_required(VERSION 3.0.2)
+set(CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR} ${CMAKE_MODULE_PATH})
+set(CMAKE_DEBUG_POSTFIX _d)
# define the project
project(
Caelum
@@ -29,7 +31,12 @@
SET(CMAKE_USE_RELATIVE_PATHS OFF)
-find_package(OGRE REQUIRED CONFIG)
+find_package(OGRE REQUIRED)
+
+add_library(OgreMain INTERFACE IMPORTED GLOBAL)
+target_include_directories(OgreMain INTERFACE ${OGRE_INCLUDE_DIRS})
+target_link_libraries(OgreMain INTERFACE ${OGRE_LIBRARIES})
+
# setup paths
SET(RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin/")

View File

@ -0,0 +1,8 @@
--- a/main/CMakeLists.txt
+++ b/main/CMakeLists.txt
@@ -34,4 +34,4 @@ install(DIRECTORY ${CMAKE_SOURCE_DIR}/main/include/ DESTINATION ${CMAKE_INSTALL_
install(DIRECTORY ${CMAKE_BINARY_DIR}/main/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/Caelum FILES_MATCHING PATTERN "*.h" PATTERN ".svn" EXCLUDE)
# --- Ogre 3D graphics engine ---
-target_link_libraries(${CMAKE_PROJECT_NAME} PUBLIC OgreMain)
+target_link_libraries(${CMAKE_PROJECT_NAME} PUBLIC OGRE::OGRE)

View File

@ -1,5 +1,5 @@
versions:
"0.6.3":
folder: all
"0.6.4":
"2022.08":
folder: all

View File

@ -5,13 +5,6 @@ sources:
"1.3.0":
url: "https://github.com/OGRECave/ogre-pagedgeometry/archive/18ca8a0abd26cb5d52b99ad8e8fa0c8f7e6e7d79.zip"
sha256: "4a3d97d75f7417208403bd0f5e8c3b010ae0dd9a36968f78ecc5cd0161b2ddb9"
patches:
"1.2.0":
- patch_file: "patches/1.2.0/CMakeLists.txt.patch"
"1.3.0":
- patch_file: "patches/1.3.0/CMakeLists.txt.patch"
requirements:
"1.2.0":
- "ogre3d/[1.x]@anotherfoxguy/stable"
"1.3.0":
- "ogre3d/[13.x]@anotherfoxguy/stable"
"2022.08":
url: "https://github.com/OGRECave/ogre-pagedgeometry/archive/8637c7f4b6238ced28e741bb6e4d4ddc8b60b477.zip"
sha256: "b83884652dc773e6c58e8efebfb950de714f6e34161a0fb388d2f546efea3a87"

View File

@ -1,40 +1,50 @@
from conans import ConanFile, CMake, tools
class PagedGeometryConan(ConanFile):
name = "ogre3d-pagedgeometry"
license = "GNU Lesser General Public License v2.1"
url = "https://github.com/RigsOfRods/Caelum/issues"
description = "PagedGeometry is a plugin for OGRE for rendering of dense vegetation "
settings = "os", "compiler", "build_type", "arch"
generators = "cmake_find_package"
exports_sources = "patches/**"
def requirements(self):
for req in self.conan_data["requirements"][self.version]:
self.requires(req)
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)
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
def package(self):
cmake = CMake(self)
cmake.install()
def package_info(self):
self.cpp_info.name = "PagedGeometry"
self.cpp_info.includedirs = [
'include',
'include/PagedGeometry'
]
self.cpp_info.libs = tools.collect_libs(self)
def package_id(self):
self.info.requires["ogre3d"].full_recipe_mode()
from conan import ConanFile
from conan.tools.files import get, collect_libs
from conan.tools.cmake import CMakeToolchain, CMake, CMakeDeps, cmake_layout
class PagedGeometryConan(ConanFile):
name = "ogre3d-pagedgeometry"
license = "GNU Lesser General Public License v2.1"
url = "https://github.com/RigsOfRods/Caelum/issues"
description = "PagedGeometry is a plugin for OGRE for rendering of dense vegetation "
settings = "os", "compiler", "build_type", "arch"
def layout(self):
cmake_layout(self)
def requirements(self):
self.requires("ogre3d/[13.x]@anotherfoxguy/stable")
self.requires("libpng/1.6.38")
def source(self):
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 build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
def package(self):
cmake = CMake(self)
cmake.install()
def package_info(self):
self.cpp_info.set_property("cmake_module_file_name", "PagedGeometry")
self.cpp_info.set_property("cmake_module_target_name", "PagedGeometry::PagedGeometry")
self.cpp_info.set_property("cmake_file_name", "PagedGeometry")
self.cpp_info.set_property("cmake_target_name", "PagedGeometry::PagedGeometry")
self.cpp_info.includedirs = [
'include',
'include/PagedGeometry'
]
self.cpp_info.libs = collect_libs(self)
def package_id(self):
self.info.requires["ogre3d"].full_recipe_mode()

View File

@ -1,20 +0,0 @@
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -7,7 +7,7 @@
# cmake system for PagedGeometry updated on 2-9-2021 by Edgar{at}AnotherFoxGuy{DOT}com
cmake_minimum_required(VERSION 3.0.2)
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
+set(CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR} ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
# define the project
project(
@@ -101,7 +101,7 @@
ENDIF ()
# --- Ogre 3D graphics engine ---
-find_package(OGRE REQUIRED CONFIG)
+find_package(OGRE REQUIRED)
# now add the directories
add_subdirectory(source)

View File

@ -0,0 +1,20 @@
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -8,6 +8,8 @@
cmake_minimum_required(VERSION 3.1)
+set(CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR} ${CMAKE_MODULE_PATH})
+
# define the project
project(
PagedGeometry
@@ -100,7 +102,7 @@
ENDIF ()
# --- Ogre 3D graphics engine ---
-find_package(OGRE REQUIRED CONFIG)
+find_package(OGRE REQUIRED)
# now add the directories
add_subdirectory(source)

View File

@ -1,5 +1,5 @@
versions:
"1.2.0":
folder: all
"1.3.0":
"2022.08":
folder: all

View File

@ -4,14 +4,7 @@ sources:
sha256: "31c84051ffe9a3710c553cfa27ebda7b176c9dfe3b4d2a113d4f02caf48ecd5b"
patches:
"1.11.6.1":
- patch_file: "patches/1.11.6.1/CMakeLists.txt.patch"
- patch_file: "patches/1.11.6.1/Samples-CMakeList.txt.patch"
- patch_file: "patches/1.11.6.1/FixOverlayCMakeLists.txt.patch"
- patch_file: "patches/1.11.6.1/scriptlexer.patch"
requirements:
- "zlib/[1.x]"
- "zziplib/[0.13.x]"
- "freetype/[2.x]"
- "freeimage/[3.x]"
- "cg-toolkit/3.1@anotherfoxguy/stable"
- "pugixml/[1.x]"
- patch_file: "patches/1.11.6.1/FixFreeImage.patch"
- patch_file: "patches/1.11.6.1/FixSamples.patch"
- patch_file: "patches/1.11.6.1/FixOverlay.patch"
- patch_file: "patches/1.11.6.1/scriptlexer.patch"

View File

@ -1,7 +1,8 @@
import shutil
from conans import ConanFile, CMake, tools
from conans.tools import os_info, SystemPackageTool
from conan import ConanFile
from conan.tools.files import get, collect_libs, rmdir, replace_in_file, apply_conandata_patches, export_conandata_patches
from conan.tools.cmake import CMakeToolchain, CMake, CMakeDeps, cmake_layout
from conan.tools.system.package_manager import Apt
import os
class OGREConan(ConanFile):
name = "ogre3d"
@ -9,88 +10,93 @@ class OGREConan(ConanFile):
url = "https://github.com/AnotherFoxGuy/conan-OGRE"
description = "scene-oriented, flexible 3D engine written in C++"
settings = "os", "compiler", "build_type", "arch"
generators = "cmake_paths", "cmake_find_package"
exports_sources = "patches/**"
def export_sources(self):
export_conandata_patches(self)
def layout(self):
cmake_layout(self)
def requirements(self):
for req in self.conan_data["requirements"]:
self.requires(req)
if os_info.is_windows:
self.requires("zlib/[~1]")
self.requires("zziplib/[~0]")
self.requires("freetype/[~2]")
self.requires("freeimage/[~3]")
self.requires("cg-toolkit/3.1@anotherfoxguy/stable")
self.requires("pugixml/[~1]")
if self.settings.os == "Windows":
self.requires("directx-sdk/9.0@anotherfoxguy/stable")
def system_requirements(self):
if os_info.is_linux:
if os_info.with_apt:
installer = SystemPackageTool()
installer.install("libgles2-mesa-dev")
installer.install("libglu1-mesa-dev")
installer.install("libx11-dev")
installer.install("libxaw7-dev")
installer.install("libxrandr-dev")
installer.install("libxt-dev")
Apt(self).install([
"libx11-dev",
"libxaw7-dev",
"libxrandr-dev",
"libgles2-mesa-dev",
"libvulkan-dev",
"glslang-dev"
], check=True)
def source(self):
tools.get(**self.conan_data["sources"][self.version], strip_root=True)
tools.replace_in_file(
"CMake/Dependencies.cmake",
get(self, **self.conan_data["sources"][self.version], strip_root=True)
def generate(self):
tc = CMakeToolchain(self)
tc.variables["OGRE_BUILD_COMPONENT_BITES"] = "ON"
tc.variables["OGRE_BUILD_COMPONENT_CSHARP"] = "OFF"
tc.variables["OGRE_BUILD_COMPONENT_JAVA"] = "OFF"
tc.variables["OGRE_BUILD_COMPONENT_OVERLAY_IMGUI"] = "ON"
tc.variables["OGRE_BUILD_COMPONENT_PYTHON"] = "OFF"
tc.variables["OGRE_BUILD_DEPENDENCIES"] = "OFF"
tc.variables["OGRE_BUILD_PLUGIN_STBI"] = "ON"
tc.variables["OGRE_BUILD_PLUGIN_EXRCODEC"] = "OFF"
tc.variables["OGRE_BUILD_RENDERSYSTEM_D3D11"] = "ON"
tc.variables["OGRE_BUILD_RENDERSYSTEM_D3D9"] = "ON"
tc.variables["OGRE_BUILD_RENDERSYSTEM_GL3PLUS"] = "OFF"
tc.variables["OGRE_BUILD_SAMPLES"] = "OFF"
tc.variables["OGRE_INSTALL_SAMPLES"] = "OFF"
tc.variables["OGRE_RESOURCEMANAGER_STRICT"] = 0
if self.settings.os == "Windows":
tc.variables["CMAKE_CXX_FLAGS"] = "-D_OGRE_FILESYSTEM_ARCHIVE_UNICODE"
tc.generate()
deps = CMakeDeps(self)
deps.generate()
def _patch_sources(self):
apply_conandata_patches(self)
replace_in_file(self,
os.path.join(self.source_folder, "CMake/Dependencies.cmake"),
"find_package(DirectX)",
"find_package(DirectX9)",
)
tools.replace_in_file(
"CMake/Dependencies.cmake",
"find_package(FreeImage)",
"find_package(ConanFreeImage)",
)
tools.replace_in_file(
"CMake/Dependencies.cmake",
"find_package(ZZip)",
"find_package(ConanZZip)",
)
tools.replace_in_file(
"CMake/Packages/FindDirectX11.cmake",
replace_in_file(self,
os.path.join(self.source_folder, "CMake/Packages/FindDirectX11.cmake"),
'find_path(DirectX11_INCLUDE_DIR NAMES d3d11.h HINTS "',
'find_path(DirectX11_INCLUDE_DIR NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NAMES d3d11.h HINTS "',
)
shutil.copyfile(
"patches/FindFreeImage.cmake", "CMake/Packages/FindConanFreeImage.cmake"
)
shutil.copyfile("patches/FindZZip.cmake", "CMake/Packages/FindConanZZip.cmake")
for patch in self.conan_data["patches"][self.version]:
tools.patch(**patch)
def build(self):
self._patch_sources()
cmake = CMake(self)
cmake.definitions["OGRE_BUILD_COMPONENT_BITES"] = "ON"
cmake.definitions["OGRE_BUILD_COMPONENT_CSHARP"] = "OFF"
cmake.definitions["OGRE_BUILD_COMPONENT_JAVA"] = "OFF"
cmake.definitions["OGRE_BUILD_COMPONENT_OVERLAY_IMGUI"] = "ON"
cmake.definitions["OGRE_BUILD_COMPONENT_PYTHON"] = "OFF"
cmake.definitions["OGRE_BUILD_DEPENDENCIES"] = "OFF"
cmake.definitions["OGRE_BUILD_PLUGIN_STBI"] = "ON"
cmake.definitions["OGRE_BUILD_PLUGIN_EXRCODEC"] = "OFF"
cmake.definitions["OGRE_BUILD_RENDERSYSTEM_D3D11"] = "ON"
cmake.definitions["OGRE_BUILD_RENDERSYSTEM_D3D9"] = "ON"
cmake.definitions["OGRE_BUILD_RENDERSYSTEM_GL3PLUS"] = "OFF"
cmake.definitions["OGRE_BUILD_SAMPLES"] = "OFF"
cmake.definitions["OGRE_INSTALL_SAMPLES"] = "OFF"
cmake.definitions["OGRE_RESOURCEMANAGER_STRICT"] = 0
if os_info.is_windows:
cmake.definitions["CMAKE_CXX_FLAGS"] = "-D_OGRE_FILESYSTEM_ARCHIVE_UNICODE"
cmake.configure()
cmake.build()
def package(self):
cmake = CMake(self)
cmake.install()
rmdir(self, os.path.join(self.package_folder, "CMake"))
rmdir(self, os.path.join(self.package_folder, "Docs"))
def package_info(self):
self.cpp_info.name = "OGRE"
self.cpp_info.set_property("cmake_module_file_name", "OGRE")
self.cpp_info.set_property("cmake_module_target_name", "OGRE::OGRE")
self.cpp_info.set_property("cmake_file_name", "OGRE")
self.cpp_info.set_property("cmake_target_name", "OGRE::OGRE")
self.cpp_info.includedirs = [
"include",
"include/OGRE",
"include/OGRE/Bites",
"include/OGRE/HLMS",
"include/OGRE/MeshLodGenerator",
"include/OGRE/Overlay",
"include/OGRE/Paging",
@ -102,4 +108,4 @@ class OGREConan(ConanFile):
"include/OGRE/Threading",
"include/OGRE/Volume",
]
self.cpp_info.libs = tools.collect_libs(self)
self.cpp_info.libs = collect_libs(self)

View File

@ -1,20 +0,0 @@
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -16,6 +16,8 @@
cmake_minimum_required(VERSION 3.3.0)
+include(${CMAKE_BINARY_DIR}/conan_paths.cmake)
+
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
@@ -63,6 +65,7 @@
# Include necessary submodules
set(CMAKE_MODULE_PATH
+ "${CMAKE_BINARY_DIR}"
"${PROJECT_SOURCE_DIR}/CMake"
"${PROJECT_SOURCE_DIR}/CMake/Utils"
"${PROJECT_SOURCE_DIR}/CMake/Packages"

View File

@ -0,0 +1,11 @@
--- a/PlugIns/FreeImageCodec/CMakeLists.txt
+++ b/PlugIns/FreeImageCodec/CMakeLists.txt
@@ -13,7 +13,7 @@ set(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/OgreFreeImageCodec.cpp")
add_definitions(-DFREEIMAGE_LIB)
add_library(Codec_FreeImage ${OGRE_LIB_TYPE} ${HEADER_FILES} ${SOURCES})
-target_link_libraries(Codec_FreeImage PUBLIC OgreMain ${FreeImage_LIBRARIES})
+target_link_libraries(Codec_FreeImage PUBLIC OgreMain freeimage::FreeImage)
target_include_directories(Codec_FreeImage PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
$<INSTALL_INTERFACE:include/OGRE/Plugins/FreeImageCodec>

View File

@ -1,11 +1,13 @@
--- Components/Overlay/CMakeLists.txt
+++ Components/Overlay/CMakeLists.txt
@@ -21,7 +21,7 @@
diff --git a/Components/Overlay/CMakeLists.txt b/Components/Overlay/CMakeLists.txt
index 1ed646080..3f0b75c33 100644
--- a/Components/Overlay/CMakeLists.txt
+++ b/Components/Overlay/CMakeLists.txt
@@ -21,7 +21,7 @@ file(GLOB SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
# setup target
add_library(OgreOverlay ${OGRE_COMP_LIB_TYPE} ${HEADER_FILES} ${SOURCE_FILES} ${PLATFORM_HEADER_FILES} ${PLATFORM_SOURCE_FILES})
set_target_properties(OgreOverlay PROPERTIES VERSION ${OGRE_SOVERSION} SOVERSION ${OGRE_SOVERSION})
-target_link_libraries(OgreOverlay PUBLIC OgreMain PRIVATE "${FREETYPE_LIBRARIES}" ZLIB::ZLIB)
+target_link_libraries(OgreOverlay PUBLIC OgreMain PRIVATE Freetype::Freetype ZLIB::ZLIB)
+target_link_libraries(OgreOverlay PUBLIC OgreMain PRIVATE freetype ZLIB::ZLIB)
target_include_directories(OgreOverlay PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
$<INSTALL_INTERFACE:include/OGRE/Overlay>

View File

@ -23,43 +23,70 @@ sources:
"13.4.4":
url: "https://github.com/OGRECave/ogre/archive/refs/tags/v13.4.4.tar.gz"
sha256: "7cf05dbb3acbfc9326daecb60429a8ae9ce7625fb425e6a29de00cf77454596f"
"13.5.0":
url: "https://github.com/OGRECave/ogre/archive/refs/tags/v13.5.0.tar.gz"
sha256: "94d514d03d421c43af09e916ecd127685e15afed62e2f4cde8949b7818bc4900"
"13.5.1":
url: "https://github.com/OGRECave/ogre/archive/refs/tags/v13.5.1.tar.gz"
sha256: "ce7e0c65d3395ad214567bdd616ee20df16769f452f1fd3e1ac6c5970890df81"
"13.5.2":
url: "https://github.com/OGRECave/ogre/archive/refs/tags/v13.5.2.tar.gz"
sha256: "165d4c7cfdf4a6026398a8ca466c6e656118569b549eaf37b6de68d843012d1f"
"13.5.3":
url: "https://github.com/OGRECave/ogre/archive/refs/tags/v13.5.3.tar.gz"
sha256: "8f966174cd537a1eb3da763d86a1da29ab8465ca29a54093bba3457b53bbde29"
"13.6.0":
url: "https://github.com/OGRECave/ogre/archive/refs/tags/v13.6.0.tar.gz"
sha256: "d32e58ad18d5fd9518f6a0dff4e566c281adc7a458b8231aa730983a8646bf95"
"13.6.1":
url: "https://github.com/OGRECave/ogre/archive/refs/tags/v13.6.1.tar.gz"
sha256: "9fe7410fec4852daf83a52cc137226592430696b1c96896f97f677d90421a44c"
"13.6.2":
url: "https://github.com/OGRECave/ogre/archive/refs/tags/v13.6.2.tar.gz"
sha256: "76b6e7708a429bae8bf2974569eac759604c7175a43a04cfe4e43eef0ad17abf"
patches:
"13.2.4":
- patch_file: "patches/13.2.4/CMakeLists.txt.patch"
- patch_file: "patches/13.2.4/pugixml-fix.patch"
- patch_file: "patches/13.2.4/FindPkgMacros.cmake.patch"
"13.3.1":
- patch_file: "patches/13.3.1/CMakeLists.txt.patch"
- patch_file: "patches/13.3.1/pugixml-fix.patch"
- patch_file: "patches/13.3.1/FindPkgMacros.cmake.patch"
"13.3.2":
- patch_file: "patches/13.3.1/CMakeLists.txt.patch"
- patch_file: "patches/13.3.1/pugixml-fix.patch"
- patch_file: "patches/13.3.1/FindPkgMacros.cmake.patch"
"13.3.3":
- patch_file: "patches/13.3.1/CMakeLists.txt.patch"
- patch_file: "patches/13.3.1/pugixml-fix.patch"
- patch_file: "patches/13.3.1/FindPkgMacros.cmake.patch"
"13.4.1":
- patch_file: "patches/13.3.1/CMakeLists.txt.patch"
- patch_file: "patches/13.3.1/pugixml-fix.patch"
- patch_file: "patches/13.3.1/FindPkgMacros.cmake.patch"
"13.4.2":
- patch_file: "patches/13.3.1/CMakeLists.txt.patch"
- patch_file: "patches/13.3.1/pugixml-fix.patch"
- patch_file: "patches/13.3.1/FindPkgMacros.cmake.patch"
"13.4.3":
- patch_file: "patches/13.3.1/CMakeLists.txt.patch"
- patch_file: "patches/13.3.1/pugixml-fix.patch"
- patch_file: "patches/13.3.1/FindPkgMacros.cmake.patch"
"13.4.4":
- patch_file: "patches/13.3.1/CMakeLists.txt.patch"
- patch_file: "patches/13.3.1/pugixml-fix.patch"
- patch_file: "patches/13.3.1/FindPkgMacros.cmake.patch"
requirements:
- "zlib/[1.x]"
- "zziplib/[0.13.x]"
- "freetype/[2.x]"
- "freeimage/[3.x]"
- "cg-toolkit/3.1@anotherfoxguy/stable"
- "pugixml/[1.x]"
"13.5.0":
- patch_file: "patches/13.3.1/pugixml-fix.patch"
- patch_file: "patches/13.3.1/FindPkgMacros.cmake.patch"
"13.5.1":
- patch_file: "patches/13.3.1/pugixml-fix.patch"
- patch_file: "patches/13.3.1/FindPkgMacros.cmake.patch"
"13.5.2":
- patch_file: "patches/13.3.1/pugixml-fix.patch"
- patch_file: "patches/13.3.1/FindPkgMacros.cmake.patch"
"13.5.3":
- patch_file: "patches/13.3.1/pugixml-fix.patch"
- patch_file: "patches/13.3.1/FindPkgMacros.cmake.patch"
"13.6.0":
- patch_file: "patches/13.3.1/pugixml-fix.patch"
- patch_file: "patches/13.3.1/FindPkgMacros.cmake.patch"
"13.6.1":
- patch_file: "patches/13.3.1/pugixml-fix.patch"
- patch_file: "patches/13.3.1/FindPkgMacros.cmake.patch"
"13.6.2":
- patch_file: "patches/13.3.1/pugixml-fix.patch"
- patch_file: "patches/13.3.1/FindPkgMacros.cmake.patch"

View File

@ -1,7 +1,8 @@
import shutil
from conans import ConanFile, CMake, tools
from conans.tools import os_info, SystemPackageTool
from conan import ConanFile
from conan.tools.files import get, collect_libs, rmdir, replace_in_file, apply_conandata_patches, export_conandata_patches
from conan.tools.cmake import CMakeToolchain, CMake, CMakeDeps, cmake_layout
from conan.tools.system.package_manager import Apt
import os
class OGREConan(ConanFile):
name = "ogre3d"
@ -9,117 +10,129 @@ class OGREConan(ConanFile):
url = "https://github.com/AnotherFoxGuy/conan-OGRE"
description = "scene-oriented, flexible 3D engine written in C++"
settings = "os", "compiler", "build_type", "arch"
generators = "cmake_find_package"
exports_sources = "patches/**"
options = {
"resourcemanager_strict": ["off", "pedantic", "strict"],
"nodeless_positioning": [True, False],
"codec_rsimage": [True, False],
}
default_options = {
"resourcemanager_strict": "strict",
"nodeless_positioning": False,
"codec_rsimage": False,
}
_cmake = None
def export_sources(self):
export_conandata_patches(self)
def _configure_cmake(self):
if self._cmake:
return self._cmake
self._cmake = CMake(self)
self._cmake.definitions["OGRE_BUILD_COMPONENT_BITES"] = "ON"
self._cmake.definitions["OGRE_BUILD_COMPONENT_CSHARP"] = "OFF"
self._cmake.definitions["OGRE_BUILD_COMPONENT_JAVA"] = "OFF"
self._cmake.definitions["OGRE_BUILD_COMPONENT_OVERLAY_IMGUI"] = "ON"
self._cmake.definitions["OGRE_BUILD_COMPONENT_PYTHON"] = "OFF"
self._cmake.definitions["OGRE_BUILD_DEPENDENCIES"] = "OFF"
self._cmake.definitions["OGRE_BUILD_PLUGIN_DOT_SCENE"] = "OFF"
self._cmake.definitions["OGRE_BUILD_PLUGIN_STBI"] = "ON"
self._cmake.definitions["OGRE_BUILD_PLUGIN_EXRCODEC"] = "OFF"
self._cmake.definitions["OGRE_BUILD_RENDERSYSTEM_D3D11"] = "ON"
self._cmake.definitions["OGRE_BUILD_RENDERSYSTEM_D3D9"] = "ON"
self._cmake.definitions["OGRE_BUILD_RENDERSYSTEM_GL3PLUS"] = "OFF"
self._cmake.definitions["OGRE_BUILD_SAMPLES"] = "OFF"
self._cmake.definitions["OGRE_COPY_DEPENDENCIES"] = "OFF"
self._cmake.definitions["OGRE_INSTALL_DEPENDENCIES"] = "OFF"
self._cmake.definitions["OGRE_INSTALL_SAMPLES"] = "OFF"
self._cmake.definitions[
"OGRE_NODELESS_POSITIONING"
] = self.options.nodeless_positioning
if self.options.resourcemanager_strict == "off":
self._cmake.definitions["OGRE_RESOURCEMANAGER_STRICT"] = 0
elif self.options.resourcemanager_strict == "pedantic":
self._cmake.definitions["OGRE_RESOURCEMANAGER_STRICT"] = 1
else:
self._cmake.definitions["OGRE_RESOURCEMANAGER_STRICT"] = 2
if os_info.is_windows:
self._cmake.definitions[
"CMAKE_CXX_FLAGS"
] = "-D_OGRE_FILESYSTEM_ARCHIVE_UNICODE"
self._cmake.configure()
return self._cmake
def layout(self):
cmake_layout(self)
def requirements(self):
for req in self.conan_data["requirements"]:
self.requires(req)
if os_info.is_windows:
self.requires("zlib/[1.x]")
self.requires("zziplib/[0.13.x]")
self.requires("freetype/[2.x]")
self.requires("freeimage/[3.x]")
self.requires("cg-toolkit/3.1@anotherfoxguy/stable")
self.requires("pugixml/[1.x]")
self.requires("libpng/1.6.38")
self.requires("sdl/[2.x]")
if self.settings.os == "Windows":
self.requires("directx-sdk/9.0@anotherfoxguy/stable")
def system_requirements(self):
if os_info.is_linux:
if os_info.with_apt:
installer = SystemPackageTool()
installer.install("libx11-dev")
installer.install("libxaw7-dev")
installer.install("libxrandr-dev")
installer.install("libgles2-mesa-dev")
installer.install("libvulkan-dev")
installer.install("glslang-dev")
Apt(self).install([
"libx11-dev",
"libxaw7-dev",
"libxrandr-dev",
"libgles2-mesa-dev",
"libvulkan-dev",
"glslang-dev"
], check=True)
def source(self):
tools.get(**self.conan_data["sources"][self.version], strip_root=True)
tools.replace_in_file(
"CMake/Dependencies.cmake",
get(self, **self.conan_data["sources"][self.version], strip_root=True)
def generate(self):
tc = CMakeToolchain(self)
tc.variables["OGRE_BUILD_COMPONENT_BITES"] = "ON"
tc.variables["OGRE_BUILD_COMPONENT_CSHARP"] = "OFF"
tc.variables["OGRE_BUILD_COMPONENT_JAVA"] = "OFF"
tc.variables["OGRE_BUILD_COMPONENT_OVERLAY_IMGUI"] = "ON"
tc.variables["OGRE_BUILD_COMPONENT_PYTHON"] = "OFF"
tc.variables["OGRE_BUILD_COMPONENT_BULLET"] = "OFF"
tc.variables["OGRE_BUILD_DEPENDENCIES"] = "OFF"
tc.variables["OGRE_BUILD_PLUGIN_DOT_SCENE"] = "OFF"
tc.variables["OGRE_BUILD_PLUGIN_STBI"] = "ON"
tc.variables["OGRE_BUILD_PLUGIN_EXRCODEC"] = "OFF"
tc.variables["OGRE_BUILD_RENDERSYSTEM_D3D11"] = "ON"
tc.variables["OGRE_BUILD_RENDERSYSTEM_D3D9"] = "ON"
tc.variables["OGRE_BUILD_RENDERSYSTEM_GL3PLUS"] = "OFF"
tc.variables["OGRE_BUILD_SAMPLES"] = "OFF"
tc.variables["OGRE_COPY_DEPENDENCIES"] = "OFF"
tc.variables["OGRE_INSTALL_DEPENDENCIES"] = "OFF"
tc.variables["OGRE_INSTALL_SAMPLES"] = "OFF"
tc.variables["OGRE_BUILD_PLUGIN_RSIMAGE"] = self.options.codec_rsimage
tc.variables["OGRE_NODELESS_POSITIONING"] = self.options.nodeless_positioning
if self.options.resourcemanager_strict == "off":
tc.variables["OGRE_RESOURCEMANAGER_STRICT"] = 0
elif self.options.resourcemanager_strict == "pedantic":
tc.variables["OGRE_RESOURCEMANAGER_STRICT"] = 1
else:
tc.variables["OGRE_RESOURCEMANAGER_STRICT"] = 2
if self.settings.os == "Windows":
tc.variables["CMAKE_CXX_FLAGS"] = "-D_OGRE_FILESYSTEM_ARCHIVE_UNICODE"
tc.generate()
deps = CMakeDeps(self)
deps.generate()
def _patch_sources(self):
apply_conandata_patches(self)
replace_in_file(self,
os.path.join(self.source_folder, "CMake/Dependencies.cmake"),
"find_package(DirectX)",
"find_package(DirectX9)",
)
tools.replace_in_file(
"CMake/Dependencies.cmake",
"find_package(FreeImage)",
"find_package(ConanFreeImage)",
replace_in_file(self,
os.path.join(self.source_folder, "PlugIns/FreeImageCodec/CMakeLists.txt"),
"${FreeImage_LIBRARIES}",
"freeimage::FreeImage",
)
tools.replace_in_file(
"CMake/Packages/FindDirectX11.cmake",
replace_in_file(self,
os.path.join(self.source_folder, "Components/Overlay/CMakeLists.txt"),
"${FREETYPE_LIBRARIES}",
"freetype",
)
replace_in_file(self,
os.path.join(self.source_folder, "CMake/Packages/FindDirectX11.cmake"),
'find_path(DirectX11_INCLUDE_DIR NAMES d3d11.h HINTS "',
'find_path(DirectX11_INCLUDE_DIR NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NAMES d3d11.h HINTS "',
)
shutil.copyfile(
"patches/FindFreeImage.cmake", "CMake/Packages/FindConanFreeImage.cmake"
)
for patch in self.conan_data["patches"][self.version]:
tools.patch(**patch)
def build(self):
cmake = self._configure_cmake()
self._patch_sources()
cmake = CMake(self)
cmake.configure()
cmake.build()
def package(self):
cmake = self._configure_cmake()
cmake = CMake(self)
cmake.install()
rmdir(self, os.path.join(self.package_folder, "CMake"))
rmdir(self, os.path.join(self.package_folder, "Docs"))
def package_info(self):
self.cpp_info.name = "OGRE"
self.cpp_info.set_property("cmake_module_file_name", "OGRE")
self.cpp_info.set_property("cmake_module_target_name", "OGRE::OGRE")
self.cpp_info.set_property("cmake_file_name", "OGRE")
self.cpp_info.set_property("cmake_target_name", "OGRE::OGRE")
self.cpp_info.includedirs = [
"include",
"include/OGRE",
"include/OGRE/Bites",
"include/OGRE/HLMS",
"include/OGRE/MeshLodGenerator",
"include/OGRE/Overlay",
"include/OGRE/Paging",
@ -131,4 +144,4 @@ class OGREConan(ConanFile):
"include/OGRE/Threading",
"include/OGRE/Volume",
]
self.cpp_info.libs = tools.collect_libs(self)
self.cpp_info.libs = collect_libs(self)

View File

@ -1,10 +0,0 @@
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -76,6 +76,7 @@
# Include necessary submodules
set(CMAKE_MODULE_PATH
+ "${CMAKE_BINARY_DIR}"
"${PROJECT_SOURCE_DIR}/CMake"
"${PROJECT_SOURCE_DIR}/CMake/Utils"
"${PROJECT_SOURCE_DIR}/CMake/Packages"

View File

@ -1,10 +0,0 @@
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -80,6 +80,7 @@
# Include necessary submodules
set(CMAKE_MODULE_PATH
+ "${CMAKE_BINARY_DIR}"
"${PROJECT_SOURCE_DIR}/CMake"
"${PROJECT_SOURCE_DIR}/CMake/Utils"
"${PROJECT_SOURCE_DIR}/CMake/Packages"

7
ogre/2.3/conandata.yml Normal file
View File

@ -0,0 +1,7 @@
sources:
"2022.10":
url: "https://github.com/OGRECave/ogre-next/archive/ede1690bb3dcf932df6a06f06e9e6de585e5eeea.tar.gz"
sha256: "6baf05cc4dc14cb70b6f4a958dbc7ac79a209eb9658733d0b19f651a5f96da08"
"2023.01":
url: "https://github.com/OGRECave/ogre-next/archive/186ea7ee972860ed09bcdbcdd99f609348c6aa8b.tar.gz"
sha256: "38a93399b5ce2b053894e858cafa3830118ff938f40204c727a77c9233744e8f"

137
ogre/2.3/conanfile.py Normal file
View File

@ -0,0 +1,137 @@
from conan import ConanFile
from conan.tools.files import get, collect_libs, rmdir, replace_in_file, apply_conandata_patches, export_conandata_patches
from conan.tools.cmake import CMakeToolchain, CMake, CMakeDeps, cmake_layout
from conan.tools.system.package_manager import Apt
import os
class OGRENextConan(ConanFile):
name = "ogre3d-next"
license = "MIT"
url = "https://github.com/AnotherFoxGuy/conan-OGRE"
description = "scene-oriented, flexible 3D engine written in C++"
settings = "os", "compiler", "build_type", "arch"
def export_sources(self):
export_conandata_patches(self)
def layout(self):
cmake_layout(self)
def requirements(self):
self.requires("zlib/[1.x]")
self.requires("zziplib/[0.13.x]")
self.requires("freetype/[2.x]")
self.requires("freeimage/[3.x]")
self.requires("rapidjson/cci.20220822")
self.requires("libpng/1.6.38")
self.requires("sdl/[2.x]")
self.requires("tinyxml/[2.x]")
def system_requirements(self):
Apt(self).install([
"libx11-dev",
"libxaw7-dev",
"libxrandr-dev",
"libgles2-mesa-dev",
"libvulkan-dev",
"glslang-dev"
], check=True)
def source(self):
get(self, **self.conan_data["sources"][self.version], strip_root=True)
def generate(self):
tc = CMakeToolchain(self)
tc.variables["OGRE_BUILD_COMPONENT_ATMOSPHERE"] = "ON"
tc.variables["OGRE_BUILD_COMPONENT_BITES"] = "ON"
tc.variables["OGRE_BUILD_COMPONENT_CSHARP"] = "OFF"
tc.variables["OGRE_BUILD_COMPONENT_JAVA"] = "OFF"
tc.variables["OGRE_BUILD_COMPONENT_OVERLAY_IMGUI"] = "ON"
tc.variables["OGRE_BUILD_COMPONENT_PYTHON"] = "OFF"
tc.variables["OGRE_BUILD_COMPONENT_TERRAIN"] = "ON"
#tc.variables["OGRE_BUILD_COMPONENT_PAGING"] = "ON" # Completly broken
tc.variables["OGRE_BUILD_DEPENDENCIES"] = "OFF"
tc.variables["OGRE_BUILD_PLUGIN_DOT_SCENE"] = "OFF"
tc.variables["OGRE_BUILD_PLUGIN_EXRCODEC"] = "OFF"
tc.variables["OGRE_BUILD_RENDERSYSTEM_D3D11"] = "ON"
tc.variables["OGRE_BUILD_RENDERSYSTEM_GL3PLUS"] = "OFF"
tc.variables["OGRE_BUILD_SAMPLES"] = "OFF"
tc.variables["OGRE_BUILD_SAMPLES2"] = "OFF"
tc.variables["OGRE_CONFIG_ENABLE_JSON"] = "ON"
tc.variables["OGRE_COPY_DEPENDENCIES"] = "OFF"
tc.variables["OGRE_INSTALL_DEPENDENCIES"] = "OFF"
tc.variables["OGRE_INSTALL_SAMPLES"] = "OFF"
tc.generate()
deps = CMakeDeps(self)
deps.generate()
def _patch_sources(self):
apply_conandata_patches(self)
replace_in_file(self,
os.path.join(self.source_folder, "CMake/Dependencies.cmake"),
"find_package(Rapidjson)",
"""
find_package(RapidJSON)
set(Rapidjson_FOUND TRUE)
""",
)
replace_in_file(self,
os.path.join(self.source_folder, "Components/Overlay/CMakeLists.txt"),
"${FREETYPE_LIBRARIES}",
"freetype",
)
replace_in_file(self,
os.path.join(self.source_folder, "CMake/InstallDependencies.cmake"),
"# Install dependencies",
"return()",
)
replace_in_file(self,
os.path.join(self.source_folder, "OgreMain/CMakeLists.txt"),
"target_link_libraries(${OGRE_NEXT}Main ${LIBRARIES})",
"target_link_libraries(${OGRE_NEXT}Main ${LIBRARIES} rapidjson freeimage::FreeImage)",
)
def build(self):
self._patch_sources()
cmake = CMake(self)
cmake.configure()
cmake.build()
def package(self):
cmake = CMake(self)
cmake.install()
rmdir(self, os.path.join(self.package_folder, "CMake"))
rmdir(self, os.path.join(self.package_folder, "Docs"))
def package_info(self):
self.cpp_info.set_property("cmake_module_file_name", "OGRE")
self.cpp_info.set_property("cmake_module_target_name", "OGRE::OGRE")
self.cpp_info.set_property("cmake_file_name", "OGRE")
self.cpp_info.set_property("cmake_target_name", "OGRE::OGRE")
self.cpp_info.includedirs = [
"include",
"include/OGRE",
"include/OGRE/Animation",
"include/OGRE/Atmosphere",
"include/OGRE/CommandBuffer",
"include/OGRE/Compositor",
"include/OGRE/Compute",
"include/OGRE/Hash",
"include/OGRE/Hlms",
"include/OGRE/Hlms/Common",
"include/OGRE/Hlms/Pbs",
"include/OGRE/Hlms/Unlit",
"include/OGRE/Math",
"include/OGRE/MeshLodGenerator",
"include/OGRE/ogrestd",
"include/OGRE/Overlay",
"include/OGRE/Plugins",
"include/OGRE/RenderSystems",
"include/OGRE/SceneFormat",
"include/OGRE/Threading",
"include/OGRE/Vao",
]
# Directories where libraries can be found
self.cpp_info.libdirs = ['lib', f'lib/{self.settings.build_type}']
self.cpp_info.libs = collect_libs(self)

View File

@ -0,0 +1,11 @@
--- CMake/Utils/FindPkgMacros.cmake
+++ CMake/Utils/FindPkgMacros.cmake
@@ -82,7 +82,7 @@
if (${PREFIX}_FWK)
set(${PREFIX} ${${PREFIX}_FWK})
elseif (${PREFIX}_REL AND ${PREFIX}_DBG)
- set(${PREFIX} optimized ${${PREFIX}_REL} debug ${${PREFIX}_DBG})
+ set(${PREFIX} "$<$<CONFIG:Debug>:${${PREFIX}_DBG}>$<$<NOT:$<CONFIG:Debug>>:${${PREFIX}_REL}>")
elseif (${PREFIX}_REL)
set(${PREFIX} ${${PREFIX}_REL})
elseif (${PREFIX}_DBG)

View File

@ -0,0 +1,11 @@
--- OgreMain/CMakeLists.txt
+++ OgreMain/CMakeLists.txt
@@ -475,7 +475,7 @@
set_target_properties(OgreMain PROPERTIES OUTPUT_NAME Ogre)
endif ()
endif ()
-target_link_libraries(OgreMain ${LIBRARIES})
+target_link_libraries(OgreMain ${LIBRARIES} RapidJSON::RapidJSON freeimage::FreeImage)
if (MINGW)
# may need winsock htons functions for FreeImage
target_link_libraries(OgreMain ws2_32)

View File

@ -1,5 +1,3 @@
versions:
"1.11.6.1":
folder: "1.11"
"13.4.4":
"13.5.3":
folder: "13"

View File

@ -1,5 +1,7 @@
from conans import ConanFile, CMake, tools
from conans.tools import os_info, SystemPackageTool
from conan import ConanFile
from conan.tools.files import get, collect_libs
from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout
from conan.tools.system import package_manager
class OisConan(ConanFile):
@ -11,18 +13,22 @@ class OisConan(ConanFile):
topics = ("Input", "System")
settings = "os", "compiler", "build_type", "arch"
def layout(self):
cmake_layout(self)
def system_requirements(self):
if os_info.is_linux:
if os_info.with_apt:
installer = SystemPackageTool()
installer.install("libx11-dev")
package_manager.Apt(self).install(["libx11-dev"])
def source(self):
tools.get(**self.conan_data["sources"][self.version], strip_root=True)
get(self, **self.conan_data["sources"][self.version], strip_root=True)
def generate(self):
tc = CMakeToolchain(self)
tc.variables["OIS_BUILD_DEMOS"] = "OFF"
tc.generate()
def build(self):
cmake = CMake(self)
cmake.definitions['OIS_BUILD_DEMOS'] = 'OFF'
cmake.configure()
cmake.build()
@ -32,4 +38,4 @@ class OisConan(ConanFile):
def package_info(self):
self.cpp_info.includedirs = ['include', 'include/ois']
self.cpp_info.libs = tools.collect_libs(self)
self.cpp_info.libs = collect_libs(self)

3
run_linter.bat Normal file
View File

@ -0,0 +1,3 @@
@echo off
set PYTHONPATH=%~dp0
pylint --rcfile=linter/pylintrc_recipe %*

View File

@ -1,5 +1,6 @@
from conans import ConanFile, CMake, tools
from conan import ConanFile
from conan.tools.files import get, collect_libs
from conan.tools.cmake import CMakeToolchain, CMake, CMakeDeps, cmake_layout
class SocketwConan(ConanFile):
name = "socketw"
@ -7,14 +8,22 @@ class SocketwConan(ConanFile):
url = "https://github.com/RigsOfRods/socketw/issues"
description = "SocketW is a library which provides cross-platform socket abstraction"
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"
def layout(self):
cmake_layout(self)
def requirements(self):
for req in self.conan_data["requirements"]:
self.requires(req)
def source(self):
tools.get(**self.conan_data["sources"][self.version], strip_root=True)
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 build(self):
cmake = CMake(self)
@ -26,4 +35,8 @@ class SocketwConan(ConanFile):
cmake.install()
def package_info(self):
self.cpp_info.libs = tools.collect_libs(self)
self.cpp_info.set_property("cmake_module_file_name", "SocketW")
self.cpp_info.set_property("cmake_module_target_name", "SocketW::SocketW")
self.cpp_info.set_property("cmake_file_name", "SocketW")
self.cpp_info.set_property("cmake_target_name", "SocketW::SocketW")
self.cpp_info.libs = collect_libs(self)

21
tools/conanfile.py Normal file
View File

@ -0,0 +1,21 @@
import os
from conans import ConanFile
from conans.errors import ConanInvalidConfiguration
class conantoolsConan(ConanFile):
name = "afg-conan-tools"
version = "1.0"
description = "helper-tools"
settings = "os", "arch"
exports_sources = "bin/**"
def validate(self):
if self.settings.os != "Linux":
raise ConanInvalidConfiguration("Only Linux supported")
def package(self):
self.copy("*", src="bin", dst="bin", keep_path=True)
def package_info(self):
self.env_info.PATH.append(os.path.join(self.package_folder, "bin"))