-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconanfile.py
74 lines (62 loc) · 3.13 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
70
71
72
73
74
from conan import ConanFile
from conan.tools.scm import Git
from conan.tools.files import rmdir
from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout
import os
class Juce(ConanFile):
name="juce"
version="7.0.5"
channel="release"
user="juce"
author="JUCE ([email protected])"
homepage="https://juce.com"
url="https://github.com/juce-framework/JUCE.git"
description="JUCE is an open-source cross-platform C++ application framework for desktop and mobile applications, including VST, VST3, AU, AUv3, RTAS and AAX audio plug-ins."
topics=("audio", "plugin", "c-plus-plus", "framework", "cpp", "vst", "au", "vst3", "juce", "aax", "audiounit", "auv3")
license="https://github.com/juce-framework/JUCE/blob/master/LICENSE.md"
settings="os", "compiler", "arch", "build_type"
options = {
"build_extras": [True, False],
"build_examples": [True, False],
"enable_module_source_groups": [True, False],
"copy_plugin_after_build": [True, False],
}
default_options = {
"build_extras": False,
"build_examples": False,
"enable_module_source_groups": False,
"copy_plugin_after_build": False
}
options_description = {
"build_extras": "Controls whether targets are added for the projects in the 'examples' folder, such as the DemoRunner and PIPs.",
"build_examples" : "Controls whether targets are added for the projects in the 'extras' folder, such as the Projucer and AudioPluginHost.",
"enable_module_source_groups": "This option will make module source files browsable in IDE projects. It has no effect in non-IDE projects.",
"copy_plugin_after_build": "Controls whether plugin targets should be installed to the system after building."
}
exports_sources = "*", "!.vscode"
def layout(self):
cmake_layout(self)
def source(self):
rmdir(self, "JUCE")
Git(self).run(f"clone --depth 1 --branch {self.version} {self.url}")
def generate(self):
toolchain = CMakeToolchain(self)
toolchain.cache_variables["JUCE_BUILD_EXTRAS"] = self.options.build_extras
toolchain.cache_variables["JUCE_BUILD_EXAMPLES"] = self.options.build_examples
toolchain.cache_variables["JUCE_ENABLE_MODULE_SOURCE_GROUPS"] = self.options.enable_module_source_groups
toolchain.cache_variables["JUCE_COPY_PLUGIN_AFTER_BUILD"] = self.options.copy_plugin_after_build
toolchain.generate()
def build(self):
cmake = CMake(self)
cmake.configure(build_script_folder=os.path.join(self.source_folder, "JUCE"))
cmake.build()
def package(self):
cmake = CMake(self)
cmake.install()
def package_info(self):
# Do NOT generate "findXXX.cmake" files
self.cpp_info.set_property("cmake_find_mode", "none")
# Use "findXXX.cmake" files generated by JUCE
self.cpp_info.builddirs.append(os.path.join("lib", "cmake", f"JUCE-{self.version}"))
# make juce_lv2_helper and juceaide available in PATH
self.buildenv_info.append_path("PATH", os.path.join(str(self.package_folder), "bin", f"JUCE-{self.version}"))