-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconanfile.py
More file actions
105 lines (95 loc) · 3.19 KB
/
conanfile.py
File metadata and controls
105 lines (95 loc) · 3.19 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
from conans import ConanFile, CMake, tools
class AfvNativeConan(ConanFile):
name = "AFV-Native"
version = "1.2.0"
license = "3-Clause BSD"
author = "Chris Collins <kuroneko@sysadninjas.net>"
url = "https://github.com/xsquawkbox/AFV-Native"
description = "Portable, Native Implementation of the AFV Interface"
topics = ("vatsim", "afv", "voice", "portable")
settings = "os", "compiler", "build_type", "arch"
options = {
"shared": [True, False],
"fPIC": [True, False],
"audio_library": ["portaudio", "soundio"],
"build_examples": [True, False],
"build_tests": [True, False],
}
default_options = {
"shared": False,
"fPIC": True,
"audio_library": "portaudio",
"build_examples": False,
"build_tests": False,
"*:shared": False,
"*:fPIC": True,
"libcurl:with_ssl": "openssl",
"libevent:with_openssl": False,
"libsoundio*:enable_jack": False,
"libsoundio*:enable_pulseaudio": True,
"libsoundio*:enable_alsa": True,
}
generators = "cmake"
requires = [
"msgpack/[~3.2.0]@bincrafters/stable",
"jsonformoderncpp/[~3.7.0]@vthiery/stable",
"openssl/1.1.1i",
"libcurl/[~7.74.0]",
"libevent/[~2.1.12]",
"libopus/1.3.1@xsquawkbox/devel",
]
build_requires = [
]
exports_sources = [
"docs/*",
"!docs/api/*",
"examples/*",
"extern/*",
"!extern/*/.git",
"include/*",
"src/*",
"test/*",
"CMakeLists.txt",
"Doxyfile",
"README.md",
"COPYING.md",
"!*/imgui.ini",
"!*/afv.log",
]
def imports(self):
#self.copy("*.dll", "bin", "bin")
#self.copy("*.dylib", "lib", "lib")
#self.copy("*.so*", "lib", "lib")
if self.settings.build_type == 'Debug':
self.copy("*.pdb", "lib", "bin")
def configure(self):
pass
def requirements(self):
if self.options.audio_library == "soundio":
self.requires("libsoundio/2.0.0@xsquawkbox/devel")
elif self.options.audio_library == "portaudio":
self.requires("portaudio/v190600.20161030@bincrafters/stable")
def build_requirements(self):
if self.options.build_examples:
self.build_requires("glew/2.2.0rc2@xsquawkbox/devel")
self.build_requires("sdl2/[~2.0.9]@bincrafters/stable")
if self.options.build_tests:
self.build_requires("gtest/[~1.8.1]")
def source(self):
pass
def _configure_cmake(self):
cmake = CMake(self)
cmake.configure(source_folder=".")
cmake.definitions["AFV_NATIVE_AUDIO_LIBRARY"] = self.options.audio_library
cmake.definitions["BUILD_EXAMPLES"] = self.options.build_examples
return cmake
def build(self):
cmake = self._configure_cmake()
cmake.build()
def package(self):
cmake = self._configure_cmake()
cmake.install()
def package_info(self):
self.cpp_info.libs = ["afv_native", "speexdsp"]
if self.settings.compiler == 'Visual Studio':
self.cpp_info.defines += ["_USE_MATH_DEFINES"]