generated from jothepro/cpp-library-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
conanfile.py
69 lines (62 loc) · 2.14 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
68
69
from conans import ConanFile, CMake, tools, errors
def get_version():
version = ""
try:
version = tools.Git().run("describe --tags")
tools.save("VERSION", version)
except:
version = tools.load("VERSION")
return version[1:]
class LibCloudSyncConan(ConanFile):
name = "libcloudsync"
url = "https://github.com/jothepro/libCloudSync"
version = get_version()
description = """A simple to use C++ interface to interact with cloud storage providers."""
settings = "os", "compiler", "build_type", "arch"
license = "AGPL-3.0-or-later"
generators = "cmake_find_package", "cmake_paths"
exports = "VERSION"
exports_sources = "lib/*", "test/*", "cmake/*", "example/*", "it/*", "VERSION", "LICENSE", "CMakeLists.txt"
author = "jothepro"
options = {
"shared": [True, False],
"fPIC": [True, False]
}
default_options = {
"shared": False,
"fPIC": True,
"fakeit:integration": "catch",
"libcurl:with_ftp": False,
"libcurl:with_imap": False,
"libcurl:with_mqtt": False,
"libcurl:with_pop3": False,
"libcurl:with_rtsp": False,
"libcurl:with_smb": False,
"libcurl:with_smtp": False,
"libcurl:with_tftp": False,
}
requires = (
"nlohmann_json/3.10.4",
"pugixml/1.11",
"libcurl/7.80.0",
("cxxopts/3.0.0", "private"),
("catch2/2.13.4", "private"),
("fakeit/2.0.9", "private")
)
def config_options(self):
if self.settings.os == "Windows":
del self.options.fPIC
self.options['libcurl'].with_ssl = "schannel"
def build(self):
cmake = CMake(self)
if not tools.get_env("CONAN_RUN_TESTS", True):
cmake.definitions["BUILD_TESTING"] = "OFF"
cmake.configure()
cmake.build()
if tools.get_env("CONAN_RUN_TESTS", True):
cmake.test()
cmake.install()
def package_info(self):
self.cpp_info.names["cmake_find_package"] = "CloudSync"
self.cpp_info.names["cmake_find_package_multi"] = "CloudSync"
self.cpp_info.libs = ["CloudSync"]