-
Notifications
You must be signed in to change notification settings - Fork 0
/
conanfile.py
51 lines (43 loc) · 1.67 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
from conans import tools, ConanFile, CMake
class YoutubeDecipherConan(ConanFile):
name = "youtube_decipher"
version = "1.0.2"
default_user = "linux13524"
default_channel = "testing"
license = "MIT"
author = "Linus Kloeckner ([email protected])"
url = "https://github.com/Linux13524/YoutubeDecipher"
description = "Library to decipher youtube signatures"
homepage = "https://www.linux13524.de"
topics = ("youtube", "decipher", "signature")
settings = "os", "compiler", "build_type", "arch"
options = {"shared": [True, False], "fPIC": [True, False]}
default_options = "shared=False", "fPIC=True"
generators = "cmake"
exports = ["LICENSE.md"]
exports_sources = "src/*"
def requirements(self):
self.requires("cpr/1.3.0")
self.requires("nlohmann_json/3.10.0")
def validate(self):
tools.check_min_cppstd(self, "17")
def configure(self):
if self.settings.compiler == 'Visual Studio':
del self.options.fPIC
def build(self):
cmake = CMake(self)
cmake.configure(source_folder="src")
cmake.build()
def package(self):
cmake = CMake(self)
cmake.configure(source_folder="src")
cmake.install()
# Copy sources for debugging
if self.settings.build_type == "Debug":
self.copy("*.cpp", dst="src", src="package/src")
# Copy the license files
self.copy("LICENSE.md", dst="licenses")
def package_info(self):
LIB_POSTFIX = "-d" if self.settings.build_type == "Debug" else ""
self.cpp_info.libs = ["YoutubeDecipher" + LIB_POSTFIX]
self.cpp_info.srcdirs = "src"