-
Notifications
You must be signed in to change notification settings - Fork 5
/
conanfile.py
51 lines (44 loc) · 1.76 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
from conans import ConanFile, CMake
class SnappyStreamConan(ConanFile):
name = "csio"
version = "0.1.3"
requires = ""
settings = "os", "compiler", "build_type", "arch"
options = {"shared": [True, False], "dzip": [True, False]}
default_options = "shared=False", "dzip=False", "zlib:shared=False", "libzmq:shared=False"
generators = "cmake"
exports = ("include/*.h",
"src/*.h", "src/*.c",
"src/*.hpp", "src/*.cpp",
"src/csio_config.cfg",
"cmake/ext/nx_utils.cmake",
"CMakeLists.txt",
"README.markdown",
"LICENSE")
url = "https://github.com/hoxnox/csio.git"
def requirements(self):
if self.options.dzip:
self.requires("zlib/1.2.8@lasote/stable")
self.requires("libzmq/4.1.5@memsharded/stable")
else:
self.requires("zlib/1.2.8@lasote/stable")
def build(self):
cmake = CMake(self.settings)
other_opts = ""
if self.options.dzip:
other_opts = "-DWITH_dzip=1"
else:
other_opts = "-DWITH_dzip=0"
self.run('cmake %s -DWITH_CONAN=1 -DCMAKE_INSTALL_PREFIX=./distr %s %s' %
(self.conanfile_directory, cmake.command_line, other_opts))
self.run("cmake --build . %s" % cmake.build_config)
self.run("make install")
def package(self):
if self.options.dzip:
self.copy("dzip", dst="bin", src="distr/bin")
self.copy("*.h", dst="include", src="distr/include")
self.copy("*.a", dst="lib", src="distr/lib")
self.copy("*.lib", dst="lib", src="distr/lib")
self.copy("*.dll", dst="lib", src="distr/lib")
def package_info(self):
self.cpp_info.libs = ["csio"]