-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathconanfile.py
More file actions
80 lines (65 loc) · 2.51 KB
/
conanfile.py
File metadata and controls
80 lines (65 loc) · 2.51 KB
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
70
71
72
73
74
75
76
77
78
79
80
from conan import ConanFile
from conan.tools.build import check_min_cppstd
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.files import copy, rmdir
import os
required_conan_version = ">=2.0.9"
class EasyRTMPConan(ConanFile):
name = "easyrtmp"
description = "RTMP streaming library"
license = "LGPL-3.0-only"
homepage = "https://github.com/AlexanderBabansky/EasyRTMP"
package_type = "library"
settings = "os", "arch", "compiler", "build_type"
version = "1.0"
options = {
"shared": [True, False],
"fPIC": [True, False],
"with_openssl": [True, False],
"with_network": [True, False]
}
default_options = {
"shared": False,
"fPIC": True,
"with_openssl": False,
"with_network": True
}
implements = ["auto_shared_fpic"]
def export_sources(self):
copy(self, "CMakeLists.txt", self.recipe_folder,
self.export_sources_folder)
copy(self, "*.cpp", self.recipe_folder, self.export_sources_folder)
copy(self, "*.h", self.recipe_folder, self.export_sources_folder)
copy(self, "*.in", self.recipe_folder, self.export_sources_folder)
copy(self, "*.cmake", self.recipe_folder, self.export_sources_folder)
copy(self, "LICENSE", self.recipe_folder, self.export_sources_folder)
rmdir(self, os.path.join(self.export_sources_folder, "test_package"))
rmdir(self, os.path.join(self.export_sources_folder, ".git"))
def layout(self):
cmake_layout(self, src_folder=".")
def requirements(self):
if self.options.with_openssl:
self.requires("openssl/[>=1.1 <4]")
def validate(self):
check_min_cppstd(self, 11)
def build_requirements(self):
self.tool_requires("cmake/[>=3.16 <4]")
def generate(self):
tc = CMakeToolchain(self)
tc.cache_variables["USE_OPENSSL"] = self.options.with_openssl
tc.cache_variables["BUILD_WITH_NETWORK"] = self.options.with_network
tc.generate()
deps = CMakeDeps(self)
deps.generate()
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
def package(self):
copy(self, "LICENSE", self.source_folder,
os.path.join(self.package_folder, "licenses"))
cmake = CMake(self)
cmake.install()
rmdir(self, os.path.join(self.package_folder, "lib", "cmake"))
def package_info(self):
self.cpp_info.libs = ["easyrtmp"]