-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconanfile.py
96 lines (77 loc) · 2.69 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
from conan import ConanFile
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
import sys
required_conan_version = ">=2.0.0"
class SlabstockConanFile(ConanFile):
# Package binray configuration and metadata
# Settings: project-wide configuration that cannot be defaulted in recipes
# See alos devopsfile.py which maintains settings
# Options: package-specific configurations which can be defaulted in recipes (no operating
# related settings)
name = "slabstock"
version = "0.0.1"
package_type = "shared-library"
author = "Paul Heidenreich"
description = "SLabStock - Simulation Laboratory for Stock evaluation and prediction"
license = ""
url = ""
settings = "os", "compiler", "build_type", "arch"
options = {
"shared": [True, False],
"fPIC": [True, False]
}
default_options = {
"shared": True,
"fPIC": True
}
no_copy_source = True
# Requirements for build (tool_requires) and host (requires) context
def requirements(self):
self.requires("gtest/1.14.0")
self.requires("mariadb-connector-c/3.3.3")
self.requires("neargye-semver/0.3.0")
self.requires("zlib/1.2.11")
pass
def build_requirements(self):
self.tool_requires("cmake/3.27.7")
self.tool_requires("ninja/1.11.1")
pass
# Packaging - how to build this package
def config_options(self):
self.conanfilePrint("conanfile.py ("+ self.name +"/" + self.version+"): Calling config_options()")
if self.settings.os == "Windows":
del self.options.fPIC
pass
def layout(self):
cmake_layout(self)
pass
def generate(self):
deps = CMakeDeps(self)
deps.generate()
tc = CMakeToolchain(self, generator="Ninja")
tc.generate()
pass
def build(self):
cmake = CMake(self)
cmake.configure()
# Actual cmake call ("cmake -DC...=conan_toolchain.cmake") happens here
cmake.build()
pass
def package(self):
cmake = CMake(self)
cmake.install()
pass
def package_info(self):
self.cpp_info.libs = [
"dutil"
]
pass
###############################################################################################
#
# Helper methods used in this conanfile
#
###############################################################################################
# we print to stderr since we do not want to alter conan fucntion stdoout output
def conanfilePrint(self, string):
print(string, file=sys.stderr)
pass