-
Notifications
You must be signed in to change notification settings - Fork 0
/
conanfile.py
143 lines (122 loc) · 4.25 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
import os.path
import conan
import conan.tools.cmake
import conan.tools.files as files
class UgLibsRecipe(conan.ConanFile):
name = 'uglibs'
version = '0.0.1'
# optional metadata
license = "MIT license"
author = "Yudi Matsuzake [email protected]"
url = "https://gitlab.com/yudi-matsuzake/uglibs"
description = "uglibs is a collection of c++ libraries."
topics = (
"opengl", "containers", "graphics", "linear algebra", "modern cpp",
"metaprogramming", "render", "run-length encoding",
"interval arithmetics", "numeric computing", "ranges", "cpp20",
"tight integers container"
)
# binary configuration
settings = 'os', 'compiler', 'build_type', 'arch'
options = {'shared': [True, False], 'fPIC': [True, False]}
default_options = {'shared': False, 'fPIC': True}
generators = 'CMakeToolchain', 'CMakeDeps'
# sources are located in the same place as this recipe, copy them to the recipe
exports_sources = 'CMakeLists.txt', 'libs/*'
def layout(self):
conan.tools.cmake.cmake_layout(self)
def requirements(self):
# all
self.requires('catch2/3.4.0', test=True)
# util
self.requires(
'range-v3/0.12.0',
transitive_headers = True,
transitive_libs = True)
self.requires(
'spdlog/1.12.0',
transitive_headers = True,
transitive_libs = True)
# graphics
self.requires(
'glm/0.9.9.8',
transitive_headers = True,
transitive_libs = True)
self.requires('glad/0.1.36',
transitive_headers = True,
transitive_libs = True)
self.requires(
'imgui/cci.20220621+1.88.docking',
transitive_headers = True,
transitive_libs = True)
self.requires(
'glfw/3.3.8',
transitive_headers = True,
transitive_libs = True)
self.requires(
'boost/1.83.0',
transitive_headers = True,
transitive_libs = True)
def configure(self):
self.options['glad'].spec = 'gl'
self.options['glad'].gl_version = '4.6'
self.options['glad'].gl_profile = 'core'
def generate(self):
files.copy(
self,
"*glfw*",
os.path.join(
self.dependencies["imgui"].package_folder,
"res",
"bindings"),
os.path.join(self.build_folder, "imgui-bindings"))
files.copy(
self,
"*opengl3*",
os.path.join(
self.dependencies["imgui"].package_folder,
"res", "bindings"),
os.path.join(self.build_folder, "imgui-bindings"))
def build(self):
cmake = conan.tools.cmake.CMake(self)
cmake.configure()
cmake.build()
def package(self):
cmake = conan.tools.cmake.CMake(self)
cmake.install()
def package_info(self):
self.cpp_info.components['util'].libs = ['util']
self.cpp_info.components['util'].requires = [
'range-v3::range-v3',
'spdlog::spdlog',
]
self.cpp_info.components['util'].set_property(
'cmake_target_name',
'util')
self.cpp_info.components['gmt'].requires = ['util']
self.cpp_info.components['gmt'].set_property(
'cmake_target_name',
'gmt')
self.cpp_info.components['ia'].libs = ['ia']
self.cpp_info.components['ia'].requires = ['util']
self.cpp_info.components['ia'].set_property(
'cmake_target_name',
'ia')
self.cpp_info.components['containers'].requires = ['util']
self.cpp_info.components['containers'].set_property(
'cmake_target_name',
'containers')
self.cpp_info.components['graphics'].libs = [
'graphics', 'ugimgui'
]
self.cpp_info.components['graphics'].requires = [
'util',
'glm::glm',
'glad::glad',
'imgui::imgui',
'glfw::glfw',
'boost::boost'
]
self.cpp_info.components['graphics'].set_property(
'cmake_target_name',
'graphics')