108 lines
2.9 KiB
Python
108 lines
2.9 KiB
Python
import conan
|
|
import conan.tools.build
|
|
import conan.tools.cmake
|
|
|
|
class product_vamp_conan(conan.ConanFile):
|
|
name = "product_vamp"
|
|
version = "latest"
|
|
description = "Two-device sheet-music display and guitar remote"
|
|
license = "MIT"
|
|
package_type = "application"
|
|
settings = "os", "arch", "compiler", "build_type"
|
|
options = {
|
|
"with_tests": [
|
|
True,
|
|
False,
|
|
],
|
|
}
|
|
default_options = {
|
|
"with_tests": False,
|
|
}
|
|
python_requires = "modulus/latest"
|
|
exports = "modulus.json", "!build", "!.git", "!test_package/build"
|
|
exports_sources = (
|
|
"!build",
|
|
"!.git",
|
|
"!test_package/build",
|
|
".gitea/workflows/ci.yml",
|
|
"CMakeLists.txt",
|
|
"modulus.py",
|
|
"modulus.json",
|
|
"cmake/*.cmake",
|
|
"data/songs/*.xml",
|
|
"data/composition/*.json",
|
|
"data/models/*.json",
|
|
"data/training/*.json",
|
|
"data/training/*.xml",
|
|
"tests/fixtures/*",
|
|
"tests/fixtures/**/*",
|
|
"generator/*.py",
|
|
"generator/palette.json",
|
|
"generator/**/*.py",
|
|
"include/*.hpp",
|
|
"include/vamp_style/*.hpp",
|
|
"src/vamp_pico/*.S.in",
|
|
"include/vamp_pico/*.h",
|
|
"include/vamp_pico/capi/*.h",
|
|
"include/vamp_pico/*.hpp",
|
|
"include/vamp_protocol/*.hpp",
|
|
"include/vamp_zero/*.hpp",
|
|
"package/assets/*",
|
|
"package/assets/**/*",
|
|
"package/Dockerfile.build",
|
|
"package/config/*.json",
|
|
"package/manifest.json.in",
|
|
"package/pico/*",
|
|
"package/scripts/*.py",
|
|
"package/scripts/*.sh",
|
|
"package/zero/*",
|
|
"src/vamp_style.cpp",
|
|
"src/vamp_pico/*.cpp",
|
|
"src/vamp_protocol/*.cpp",
|
|
"src/vamp_zero/*.cpp",
|
|
"tests/CMakeLists.txt",
|
|
"tests/*.cpp",
|
|
"tests/*.hpp",
|
|
"tests/*.py",
|
|
)
|
|
def requirements(self):
|
|
self.requires(
|
|
str(self.python_requires["modulus"].ref),
|
|
transitive_headers=True,
|
|
transitive_libs=True,
|
|
options={
|
|
"with_openssl": True,
|
|
"with_sqlite": True,
|
|
"with_raylib": True,
|
|
},
|
|
)
|
|
for reference in (
|
|
"ligo/latest",
|
|
"noto/latest",
|
|
"luma/latest",
|
|
"sonus/latest",
|
|
):
|
|
self.requires(reference, transitive_headers=True, transitive_libs=True)
|
|
def generate(self):
|
|
dependencies = conan.tools.cmake.CMakeDeps(self)
|
|
dependencies.generate()
|
|
toolchain = conan.tools.cmake.CMakeToolchain(self)
|
|
if hasattr(toolchain, "user_presets_path"):
|
|
toolchain.user_presets_path = False
|
|
toolchain.variables["BUILD_TESTING"] = bool(self.options.with_tests)
|
|
toolchain.variables.update(self.python_requires["modulus"].module.python_cmake_variables(self))
|
|
toolchain.generate()
|
|
def build(self):
|
|
cmake = conan.tools.cmake.CMake(self)
|
|
cmake.configure()
|
|
cmake.build()
|
|
if self.options.with_tests and conan.tools.build.can_run(self):
|
|
cmake.test(target="check")
|
|
def package_id(self):
|
|
self.info.options.rm_safe("with_tests")
|
|
def package(self):
|
|
cmake = conan.tools.cmake.CMake(self)
|
|
cmake.install()
|
|
def package_info(self):
|
|
self.cpp_info.bindirs = ["zero/bin"]
|