-
Notifications
You must be signed in to change notification settings - Fork 49
/
conanfile.py
47 lines (40 loc) · 1.61 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from conans import ConanFile, CMake, tools
class LibonvifConan(ConanFile):
jsonInfo = json.loads(tools.load("info.json"))
name = jsonInfo["projectName"]
version = "%u.%u.%u%s" % (jsonInfo["version"]["major"], jsonInfo["version"]["minor"], jsonInfo["version"]["patch"],
"-SNAPSHOT" if jsonInfo["version"]["snapshot"] else "")
license = jsonInfo["license"]
url = jsonInfo["repository"]
description = jsonInfo["projectDescription"]
author = jsonInfo["vendor"]
homepage = jsonInfo["repository"]
requires = "Qt/[^5.12]@tereius/stable"
settings = {"os": ["Windows", "Linux", "Android", "Macos"], "compiler": None, "build_type": None, "arch": None}
options = {"shared": [True, False], "openssl": [True, False]}
default_options = "shared=True", "openssl=True"
generators = "cmake"
exports = "info.json"
exports_sources = "*"
default_user = "tereius"
default_channel = "stable"
def requirements(self):
if self.options.openssl:
self.requires("openssl/1.1.1l@tereius/stable")
self.options["openssl"].shared = True
def build(self):
if self.settings.os == 'Android':
cmake = CMake(self, generator="Unix Makefiles")
else:
cmake = CMake(self)
cmake.configure()
cmake.build()
cmake.install()
def package_info(self):
self.cpp_info.builddirs = ['cmake']
self.cpp_info.defines = ['WITH_SELF_PIPE']
if self.options.openssl:
self.cpp_info.defines = ['WITH_OPENSSL']