-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
conanfile.py
65 lines (51 loc) · 1.71 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
from conan import ConanFile
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
from conan.tools.build import check_min_cppstd
class NewtypeConan(ConanFile):
name = "newtype"
version = "2.0.0"
license = "BSD-3-Clause"
description = "A library of types and functions to create strong type aliases"
url = "https://github.com/fmorgner/newtype"
settings = ("os", "arch", "compiler", "build_type")
scm = {
"type": "git",
"url": "auto",
"revision": "auto"
}
generators = [
"CMakeDeps"
]
exports_sources = [
"source/*",
"test_package/*",
"LICENSE",
]
def build(self):
cmake = CMake(self)
cmake.configure()
if not self.conf.get("tools.build:skip_test", default=False):
cmake.build()
cmake.test()
def build_requirements(self):
self.tool_requires("cmake/[>3.25]")
self.tool_requires("ninja/[~1.11]")
self.test_requires("catch2/[~3.3]")
def generate(self):
toolchain = CMakeToolchain(self, generator="Ninja Multi-Config")
toolchain.variables["CMAKE_EXPORT_COMPILE_COMMANDS"] = True
toolchain.variables["PROJECT_VERSION"] = self.version
toolchain.variables["PROJECT_DESCRIPTION"] = self.description
toolchain.generate()
def layout(self):
cmake_layout(self, generator="Ninja Multi-Config", src_folder="source")
def package(self):
cmake = CMake(self)
cmake.install()
def package_id(self):
self.info.clear()
def package_info(self):
self.cpp_info.bindirs = []
self.cpp_info.libdirs = []
def validate(self):
check_min_cppstd(self, 20)