-
Notifications
You must be signed in to change notification settings - Fork 71
/
conanfile.py
80 lines (70 loc) · 3.84 KB
/
conanfile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
from conan import ConanFile, tools
from conan.tools.scm import Git
from conan.tools.gnu import Autotools
from conan.tools.gnu import AutotoolsDeps
from conan.tools.gnu import AutotoolsToolchain
class ThorsSerializerConan(ConanFile):
name = "thors-mongo"
version = "3.2.20"
license = "GPL-3.0"
author = "Martin York Loki.Astari@gmail.com"
url = "https://github.com/Loki-Astari/ThorsSerializer"
description = "Serialization Library including C++ Mongo layer"
topics = ("C++", "Serialization", "Mongo", "JSON", "BSON", "YAML")
settings = "os", "compiler", "build_type", "arch"
options = {"shared": [True, False], "fPIC": [True, False]}
default_options = {"shared": True, "fPIC": True}
def generate(self):
tc = AutotoolsToolchain(self)
tc.configure_args.append("--enable-test-with-conan")
tc.configure_args.append("--enable-dark-mode")
tc.configure_args.append("--disable-test-with-mongo-query")
tc.configure_args.append("--disable-Mongo-Service")
tc.configure_args.append("--disable-vera")
print("ZLib: " + self.dependencies["zlib"].package_folder)
tc.configure_args.append("--with-zlib-root=" + self.dependencies["zlib"].package_folder)
print("Yaml: " + self.dependencies["libyaml"].package_folder)
tc.configure_args.append("--with-yaml-root=" + self.dependencies["libyaml"].package_folder)
print("Snappy: " + self.dependencies["snappy"].package_folder)
tc.configure_args.append("--with-snappy-root=" + self.dependencies["snappy"].package_folder)
print("Open: " + self.dependencies["openssl"].package_folder)
tc.configure_args.append("--with-crypto-root=" + self.dependencies["openssl"].package_folder)
print("Magic: " + self.dependencies["magic_enum"].package_folder)
tc.configure_args.append("--with-magicenum-header-only-root=" + self.dependencies["magic_enum"].package_folder + "/include/magic_enum")
tc.generate()
def requirements(self):
self.requires("bzip2/1.0.8")
self.requires("zlib/1.3.1")
self.requires("libyaml/0.2.5")
self.requires("snappy/1.2.1")
self.requires("openssl/3.3.1")
self.requires("magic_enum/0.9.6")
def source(self):
git = Git(self)
git.clone(url="https://github.com/Loki-Astari/ThorsSerializer.git", target=".")
def validate(self):
tools.build.check_min_cppstd(self, 20)
def build(self):
autotools = Autotools(self)
autotools.configure()
autotools.make()
def package(self):
autotools = Autotools(self)
autotools.install()
def package_info(self):
self.cpp_info.libs = [ "ThorSerialize", "ThorsLogging", "ThorsMongo", "ThorsSocket", "ThorsStorage", # Release Sym
"ThorSerializeD", "ThorsLoggingD", "ThorsMongoD", "ThorsSocketD", "ThorsStorageD", # Debug Sym
"ThorSerialize20", "ThorsLogging20", "ThorsMongo20", "ThorsSocket20", "ThorsStorage20", # Relase Versioned
"ThorSerialize20D", "ThorsLogging20D", "ThorsMongo20D", "ThorsSocket20D", "ThorsStorage20D" # Debug Versioned
]
self.cpp_info.libdirs = ["lib"]
self.cpp_info.includedirs = [ "include",
"include/GitUtility",
"include/ThorSerialize",
"include/ThorsCrypto",
"include/ThorsIOUtil",
"include/ThorsLogging",
"include/ThorsMongo",
"include/ThorsSocket",
"include/ThorsStorage"
]