-
Notifications
You must be signed in to change notification settings - Fork 41
/
conanfile.py
51 lines (43 loc) · 1.82 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
import os
import shutil
from conans import ConanFile, CMake, tools
class OpenVDBNativePluginConan(ConanFile):
name = "OpenVDBNativePlugin"
version = "0.0.1"
license = "MIT"
description = "OpenVDBNativePlugin is an open source C++ library for Unity plugin of OpenVDB"
url = "https://github.com/karasusan/OpenVDBForUnity"
requires = ( "OpenVDB/4.0.2@kazuki/stable"
)
generators = "cmake"
settings = "os", "arch", "compiler", "build_type"
options = { "shared": [True]
, "fPIC": [True, False]
}
default_options = "shared=True", "fPIC=True"
build_policy = "missing"
def config_options(self):
if self.settings.os == "Windows":
self.options.remove("fPIC")
def configure(self):
if self.options.shared and "fPIC" in self.options.fields:
self.options.fPIC = True
# Set fPIC=True to all dependencies that have the option.
for _, pkg_opts in self.options.deps_package_values.items():
if "fPIC" in pkg_opts.fields:
pkg_opts.fPIC = True
if self.settings.os != "Windows":
self.options["TBB"].shared = False
def source(self):
self.run("git clone https://github.com/karasusan/OpenVDBForUnity src")
# self.run("cd src && git checkout v%s" % self.version)
def build(self):
cmake = CMake(self)
cmake.configure(source_dir="src/Plugin")
cmake.build()
def package(self):
self.copy("LICENSE", dst="license", src="src")
self.copy("*", dst="lib", src="lib")
self.copy("*", dst="bin", src="bin")
self.copy("openvdbi.h", dst="include", src="src/Plugin/openvdbi")
self.copy("OpenVDBImporter.h", dst="include/Importer", src="src/Plugin/openvdbi/Importer")