-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconanfile.py
79 lines (63 loc) · 2.27 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
from conans import ConanFile, tools #, CMake
from conan.tools.cmake import CMake
from conan.tools.cmake import CMakeToolchain
import os
class CGullConan(ConanFile):
name = 'CGull'
version = '0.1.0'
license = 'https://github.com/Dalvin3000/cgull-dev/blob/master/LICENSE'
url = 'https://github.com/Dalvin3000/cgull-dev'
description = 'Async primitives for C++20 inspired by BlueBird.js'
settings = 'os', 'compiler', 'build_type', 'arch'
generators = 'cmake_find_package_multi'
options = {
'shared': [True, False],
'cgull_build_tests': [True, False],
'cgull_with_boost': [True, False],
}
default_options = {
'shared': False,
'cgull_build_tests': False,
'cgull_with_boost': False,
}
revision_mode = 'scm'
exports_sources = 'src/*', 'include/*', 'CMakeLists.txt'
def source(self):
tools.download('https://github.com/Dalvin3000/cgull-dev/archive/master.zip', 'cgull.zip')
tools.unzip('cgull.zip')
os.unlink('cgull.zip')
os.system('mv cgull-dev-master/* ./')
def requirements(self):
if self.options.cgull_with_boost:
self.requires('boost/1.75.0')
def build_requirements(self):
if self.options.cgull_build_tests:
self.build_requires('gtest/1.10.0')
def generate(self):
tc = CMakeToolchain(self)
tc.variables['CGULL_BUILD_TESTS'] = self.options.cgull_build_tests
tc.variables['CGULL_WITH_BOOST'] = self.options.cgull_with_boost
tc.variables['CMAKE_FIND_PACKAGE_PREFER_CONFIG'] = True
tc.variables['CMAKE_CONFIGURATION_TYPES'] = self.settings.build_type
tc.generate()
def configure(self):
pass
def imports(self):
pass
def build(self):
cmake = CMake(self)
if self.should_configure:
cmake.configure()
if self.should_build:
cmake.build()
if self.should_install:
cmake.install()
if self.should_test:
cmake.test()
def package(self):
cmake = self._cmake
cmake.install()
def package_info(self):
self.cpp_info.name = 'CGull'
self.cpp_info.components['CGull'].name = 'CGull'
self.cpp_info.components['CGull'].libs = ['CGull']