-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconanfile.py
More file actions
61 lines (53 loc) · 1.48 KB
/
conanfile.py
File metadata and controls
61 lines (53 loc) · 1.48 KB
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
from conans import ConanFile, CMake
import subprocess
def version():
default = '0.0.0'
try:
git = subprocess.Popen(
['git', 'describe', '--long', '--dirty'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
universal_newlines=True)
except Exception:
return default
val = git.communicate()[0]
if git.returncode != 0:
return default
version = val.strip().split('-')
return '{}.{}'.format(version[0], version[1])
class BongoConan(ConanFile):
name = 'bongo'
version = version()
license = 'BSD 3-clause'
url = 'https://github.com/msteinert/bongo'
description = 'Go APIs ported to C++'
generators = 'cmake_find_package', 'cmake_paths'
settings = 'os', 'compiler', 'build_type', 'arch'
scm = {
'type': 'git',
'url': 'https://github.com/msteinert/bongo.git',
'revision': 'auto',
}
options = {
'shared': [True, False],
'fPIC': [True, False],
}
default_options = (
'shared=False',
'fPIC=True',
)
build_requires = (
'catch2/2.13.7',
)
def configure_cmake(self):
cmake = CMake(self, generator='Ninja')
cmake.configure()
return cmake
def build(self):
cmake = self.configure_cmake()
cmake.build()
def package(self):
cmake = self.configure_cmake()
cmake.install()
def package_info(self):
self.cpp_info.libs = ['bongo']