-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconanfile.py
61 lines (52 loc) · 1.94 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
from conan import ConanFile
from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps
from os import environ
class CPPAappTemplateConan(ConanFile):
name = "CppAppTemplate"
version = "0.3"
license = "OpenSource"
author = "Powco"
url = "https://github.com/ProofOfWorkCompany/cpp-app-template"
description = "Best practices with c++"
topics = ("what", "this", "app", "is", "about")
settings = "os", "compiler", "build_type", "arch"
options = {"shared": [True, False], "fPIC": [True, False]}
default_options = {"shared": False, "fPIC": True}
exports_sources = "src/*"
requires = [
"argh/1.3.2", # for parsing command-line arguments
"gtest/1.12.1", # for writing unit tests
"boost/1.80.0", # collection of libraries with practically everything
"taocpp-pegtl/3.2.7", # A parser, used for reading files or text input.
"openssl/1.1.1t" # Required for SSL with boost beast.
]
def set_version (self):
if "CIRCLE_TAG" in environ:
self.version = environ.get ("CIRCLE_TAG")[1:]
if "CURRENT_VERSION" in environ:
self.version = environ['CURRENT_VERSION']
else:
self.version = "0.3"
def config_options (self):
if self.settings.os == "Windows":
del self.options.fPIC
def configure_cmake (self):
cmake = CMake (self)
cmake.configure()
return cmake
def layout(self):
cmake_layout(self)
def generate(self):
deps = CMakeDeps(self)
deps.generate()
tc = CMakeToolchain(self)
tc.generate()
def build (self):
cmake = self.configure_cmake ()
cmake.build ()
def package (self):
cmake = CMake(self)
cmake.install()
def package_info (self):
# self.cpp_info.libdirs = ["lib"] # Default value is 'lib'
self.cpp_info.libs = ["CppAppTemplate"]