-
Notifications
You must be signed in to change notification settings - Fork 0
/
conanfile.py
50 lines (40 loc) · 1.51 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
import os
from conans import ConanFile, CMake
class VisvidConan(ConanFile):
requires = [
"ffmpeg/5.0",
]
settings = "os", "arch", "compiler", "build_type"
generators = ["cmake_paths"]
options = {
"with_createVisuals": [True, False]
}
default_options = {
"with_createVisuals": False,
}
def requirements(self):
if self.options.with_createVisuals:
self.requires("sdl/2.24.0")
# if self.settings.os == "Linux":
# self.requires("libalsa/1.2.4")
def imports(self):
self.copy("*.dll", dst="bin", src="bin") # From bin to bin
self.copy("*.dylib*", dst="bin", src="lib") # From lib to bin
def configure(self):
if self.settings.os == "Linux":
# self.options["ffmpeg"].vorbis = False
self.options["ffmpeg"].with_openjpeg = False
self.options["ffmpeg"].with_libx264 = False
self.options["ffmpeg"].with_libx265 = False
def build(self):
cmake = self._configure_cmake()
cmake.build()
def _configure_cmake(self):
cmake = CMake(self)
cmake_toolchain_file = os.path.join(self.build_folder, "conan_paths.cmake")
assert os.path.exists(cmake_toolchain_file)
cmake.definitions["CMAKE_TOOLCHAIN_FILE"] = cmake_toolchain_file
cmake.definitions["VISVID_SAMPLE_CREATEVISUALS"] = self.options.with_createVisuals
cmake.definitions["BUILD_TESTING"] = False
cmake.configure()
return cmake