-
Notifications
You must be signed in to change notification settings - Fork 2
/
conanfile.py
58 lines (51 loc) · 2.19 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
from conans import ConanFile, CMake
from conans.model.version import Version
class PushaConan(ConanFile):
name = "pusha"
version = "0.1"
license = "MIT"
author = "Rafael Cunha <[email protected]>"
url = "https://github.com/rnascunha/pusha"
description = "C/C++ implementation of Web Push"
topics = ("web", "web push", "notification")
settings = "os", "compiler", "build_type", "arch"
options = {"shared": [True, False], "fPIC": [True, False], "tools": [True, False]}
default_options = {"shared": False, "fPIC": True, "tools": False}
generators = "cmake_find_package"
exports = "LICENSE", "README.md", "URL.txt"
exports_sources = "third/*", "*.c", "*.cpp", "*.h", "*.hpp", "*.cmake", "CMakeLists.txt"
requires = "openssl/1.1.1q"
def build_requirements(self):
if CMake.get_version() < Version("3.10"):
self.tool_requires("cmake/[>= 3.10]")
def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
def build(self):
cmake = CMake(self)
cmake.definitions["WITH_TOOLS"] = self.options.tools
cmake.configure()
cmake.build()
def package(self):
#ECEC depends
self.copy("*.h", dst="third", src="third")
self.copy("*.c", dst="third", src="third")
#C API
self.copy("*.h", dst="include", src="include")
self.copy("*.c", dst="src", src="src")
#CPP API
self.copy("*.cpp", dst="src", src="src_cpp")
self.copy("*.hpp", dst="include", src="include_cpp")
#libs
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("*.lib", dst="lib", keep_path=False)
#tools
self.copy("genkey", dst="bin", src="tools", keep_path=False)
self.copy("export_key", dst="bin", src="tools", keep_path=False)
self.copy("pusha", dst="bin", src="tools", keep_path=False)
def package_info(self):
self.cpp_info.includedirs = ["include", "third/ecec/include"]
self.cpp_info.libs = ["pusha", "ece"]