-
Notifications
You must be signed in to change notification settings - Fork 0
/
conanfile.py
69 lines (52 loc) · 1.74 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
import os.path
import conans
class Lp3Main(conans.ConanFile):
name = "lp3-main"
version = "1.0.8"
license = "Zlib"
author = "Tim Simpson"
url = "https://github.com/TimSimpson/lp3-main"
description = "simple game app helper library"
settings = "os", "compiler", "build_type", "arch"
options = {"shared": [True, False]}
default_options = {"shared": False}
requires = tuple()
build_requires = []
test_requires = [
"Catch2/2.11.1@catchorg/stable",
]
@property
def tests_enabled(self):
return (
self.develop
and (os.environ.get("CONAN_SKIP_TESTS") or "").lower() != 'true'
)
def build_requirements(self):
if self.tests_enabled:
for tr in self.test_requires:
self.build_requires(tr)
generators = "cmake_find_package"
exports_sources = (
"src/*", "include/*", "demos/*", "tests/*", "CMakeLists.txt"
)
def _configed_cmake(self):
cmake = conans.CMake(self)
cmake.configure(defs={
"LP3_MAIN_Build_Tests": self.tests_enabled,
})
return cmake
def build(self):
cmake = self._configed_cmake()
cmake.build()
def package(self):
cmake = self._configed_cmake()
cmake.install()
def package_info(self):
self.cpp_info.name = "lp3-main"
_set_for_cmake(self.cpp_info.filenames, "lp3-main")
_set_for_cmake(self.cpp_info.names, "lp3")
_set_for_cmake(self.cpp_info.components['main'].names, "main")
self.cpp_info.components['main'].libs = [ "lp3-main" ]
def _set_for_cmake(attr, value):
for generator in ['cmake_find_package', 'cmake_find_package_multi']:
attr[generator] = value