-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconanfile.py
67 lines (53 loc) · 2.08 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
from conan import ConanFile
from conan.tools.cmake import CMakeDeps, CMakeToolchain, CMake, cmake_layout
from conan.tools.build import check_min_cppstd
class ModelExeConan(ConanFile):
name = "conan-model-exe"
license = "MIT"
url = "https://github.com/fpelliccioni/conan-model-exe"
description = "Model of a C++20 project using CMake, Conan and modern tooling"
settings = "os", "compiler", "build_type", "arch"
exports_sources = "CMakeLists.txt", "cmake/*", "src/*", "include/*"
def validate(self):
if self.info.settings.compiler.cppstd:
check_min_cppstd(self, "20")
def build_requirements(self):
self.test_requires("catch2/3.3.0")
# self.test_requires("doctest/2.4.9") # Alternative to Catch2
self.test_requires("nanobench/4.3.9")
# self.requires("cppfront/cci.20221024")
def requirements(self):
self.requires("jfalcou-eve/v2022.09.1")
self.requires("fmt/9.1.0")
self.requires("spdlog/1.11.0")
self.requires("lyra/1.6.1")
self.requires("expected-lite/0.6.2")
# self.requires("cthash/???")
# self.requires("fmtlog/???")
def layout(self):
cmake_layout(self)
def generate(self):
tc = CMakeToolchain(self)
# tc.variables["CMAKE_VERBOSE_MAKEFILE"] = True
tc.generate()
tc = CMakeDeps(self)
tc.generate()
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
# def package(self):
# cmake = CMake(self)
# cmake.install()
def package(self):
self.copy("*.hpp", src=".")
self.copy("*.lib", dst="lib", keep_path=False)
self.copy("*.dll", dst="bin", keep_path=False)
self.copy("*.so", dst="lib", keep_path=False)
self.copy("*.dylib", dst="lib", keep_path=False)
self.copy("*.a", dst="lib", keep_path=False)
self.copy("*model_app", dst="bin", keep_path=False)
def package_info(self):
self.cpp_info.libs = ["model"]
def deploy(self):
self.copy("model_app", src="bin", dst="bin")