forked from ess-dmsc/conan-streaming-data-types
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconanfile.py
35 lines (30 loc) · 1.1 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
import shutil
from conans import ConanFile, CMake, tools
from conans.util import files
class StreamingDataTypesConan(ConanFile):
name = "streaming-data-types"
version = "2c443ca"
license = "BSD 2-Clause"
url = "https://bintray.com/ess-dmsc/streaming-data-types"
settings = "compiler", "arch"
generators = "cmake"
requires = "flatbuffers/1.12.0"
build_requires = "flatc/1.12.0"
def source(self):
self.run(
"git clone https://github.com/ess-dmsc/{}.git".format(self.name)
)
with tools.chdir("./{}".format(self.name)):
self.run("git checkout {}".format(self.version))
def build(self):
files.mkdir("./{}/build".format(self.name))
shutil.copyfile(
"conanbuildinfo.cmake",
"./{}/build/conanbuildinfo.cmake".format(self.name)
)
with tools.chdir("./{}/build".format(self.name)):
cmake = CMake(self)
cmake.configure(source_dir="..", build_dir=".")
cmake.build(build_dir=".")
def package(self):
self.copy("*.h", dst="include", keep_path=False)