blob: 1d142498fc2633b7ca92117df4b7fabc3a2dcb1d (
plain)
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
|
import re
from conans import ConanFile, CMake
from conans.tools import load
def read_project_property(property):
try:
cmake_lists = load("CMakeLists.txt")
value = re.search(r"project\(.*{} \"(.*?)\"".format(property), cmake_lists, re.S).group(1)
return value.strip()
except:
return None
class NewtypeConan(ConanFile):
name = "newtype"
scm = {
"type": "git",
"url": "https://github.com/fmorgner/newtype.git",
"revision": "auto",
}
settings = ("compiler",)
version = read_project_property("VERSION")
license = "BSD-3-Clause"
url = "https://github.com/fmorgner/newtype"
description = read_project_property("DESCRIPTION")
generators = "cmake"
build_requires = (
"CUTE/2.2.6@fmorgner/stable",
"lyra/1.2.0"
)
def _configure_cmake(self):
cmake = CMake(self)
cmake.definitions["BUILD_TESTING"] = True
cmake.definitions["RUN_TESTS_AFTER_BUILD"] = True
cmake.configure()
return cmake
def configure(self):
del self.settings.compiler.libcxx
def build(self):
cmake = self._configure_cmake()
cmake.build()
cmake.test()
def package(self):
cmake = self._configure_cmake()
cmake.install()
def package_info(self):
if self.settings.compiler in ["gcc"]:
self.cpp_info.cxxflags.append("-std=c++2a")
|