-
Notifications
You must be signed in to change notification settings - Fork 112
/
conanfile.py
49 lines (38 loc) · 1.8 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
import os
from conan import ConanFile
from conan.tools.files import copy, update_conandata
from conan.tools.scm import Version
from conan.errors import ConanInvalidConfiguration
required_conan_version = ">=1.56.0"
class FDM_MaterialsConan(ConanFile):
name = "fdm_materials"
license = "LGPL-3.0"
author = "Ultimaker B.V."
url = "https://github.com/Ultimaker/fdm_materials"
description = "FDM Material database"
topics = ("conan", "profiles", "cura", "ultimaker", "filament")
build_policy = "missing"
exports = "LICENSE*"
settings = "os", "compiler", "build_type", "arch"
no_copy_source = True
def set_version(self):
if not self.version:
self.version = self.conan_data["version"]
def export(self):
update_conandata(self, {"version": self.version})
def export_sources(self):
copy(self, "*.fdm_material", self.recipe_folder, self.export_sources_folder)
copy(self, "*.sig", self.recipe_folder, self.export_sources_folder)
def validate(self):
if Version(self.version) <= Version("4"):
raise ConanInvalidConfiguration("Only versions 5+ are support")
def package(self):
copy(self, "*.fdm_material", self.source_folder, os.path.join(self.package_folder, "res", "resources", "materials"), keep_path = False)
copy(self, "*.sig", self.source_folder, os.path.join(self.package_folder, "res", "resources", "materials"), keep_path = False)
def package_info(self):
self.cpp_info.includedirs = []
self.cpp_info.resdirs = ["res"]
self.runenv_info.append_path("CURA_RESOURCES", os.path.join(self.package_folder, "res", "resources"))
self.env_info.CURA_RESOURCES.append(os.path.join(self.package_folder, "res", "resources"))
def package_id(self):
self.info.clear()