-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconanfile.py
executable file
·60 lines (44 loc) · 1.72 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
from conan import ConanFile
from conan.tools.cmake import CMake, cmake_layout
from conan.tools.files import copy
class sardineConan(ConanFile):
name = 'sardine'
version = '0.1.1'
license = ''
settings = 'os', 'compiler', 'build_type', 'arch'
exports_sources = 'CMakeLists.txt', 'include/*', 'src/*', 'test/*'
options = {
'python_module': [True, False],
}
default_options = {
'python_module': False,
}
def requirements(self):
self.requires('emu/1.0.0', transitive_headers=True, transitive_libs=True, options={"python": self.options.python_module})
self.requires('boost/1.86.0', transitive_headers=True, override=True)
# self.requires('fmt/11.0.0', transitive_headers=True)
self.test_requires('gtest/1.13.0')
def layout(self):
if self.options.python_module:
# Using conan as CMAKE_PROJECT_TOP_LEVEL_INCLUDES cmake_layout does not work
# We don't want to pollute the build folder with conan. We put everything in "generators"
self.folders.generators = "generators"
else:
# Otherwise, we use the default cmake layout
cmake_layout(self)
generators = 'CMakeDeps', 'CMakeToolchain'
def generate(self):
if self.options.python_module:
for dep in self.dependencies.values():
for libdir in dep.cpp_info.libdirs:
copy(self, "*.so*", libdir, self.build_folder)
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
cmake.test()
def package(self):
cmake = CMake(self)
cmake.install()
def package_info(self):
self.cpp_info.libs = ['sardine']