-
Notifications
You must be signed in to change notification settings - Fork 0
/
conanfile.py
executable file
·59 lines (51 loc) · 2.09 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
from conan import ConanFile
from conan.tools.cmake import CMake
class CompressorRecipe(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "CMakeToolchain", "CMakeDeps"
build_policy = "missing"
def requirements(self):
self.requires("nlohmann_json/3.11.3", override=True)
self.requires("json-schema-validator/[>=2.0.0]")
self.requires("fast-cpp-csv-parser/cci.20211104")
# if self.settings.os != "Windows":
self.requires("onetbb/2021.12.0")
self.requires("boost/[1.82.0]")
self.requires("parallel-hashmap/1.37")
self.requires("eigen/[>=3.4.0]")
self.requires("spdlog/[>=1.13.0]")
self.requires("gdal/[>=3.8.3]")
self.requires("melon/1.0.0-alpha.1")
self.requires("mippp/0.1")
def build_requirements(self):
self.tool_requires("cmake/3.27.1")
self.requires("gtest/1.14.0")
# self.build_requires("gcc/12.2.0")
if self.settings.os == "Windows":
self.requires("mingw-builds/12.2.0")
def generate(self):
print("conanfile.py: IDE include dirs:")
for lib, dep in self.dependencies.items():
if not lib.headers:
continue
for inc in dep.cpp_info.includedirs:
print("\t" + inc)
def cmake_variables(self):
vars = {}
if self.settings.os == "Windows":
for lib, dep in self.dependencies.items():
if lib.ref.name == "onetbb":
vars["CONAN_TBB_INCLUDE_DIR"] = ";".join(
dep.cpp_info.components["libtbb"].includedirs
)
vars["CONAN_TBB_LIB_DIR"] = ";".join(
dep.cpp_info.components["libtbb"].libdirs
)
if lib.ref.name == "mingw-builds":
vars["CONAN_MINGW_LIB_DIR"] = ";".join(dep.cpp_info.libdirs)
print("variables ", vars)
return vars
def build(self):
cmake = CMake(self)
cmake.configure(variables=self.cmake_variables())
cmake.build()