This repository has been archived by the owner on Dec 30, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
conanfile.py
52 lines (42 loc) · 1.78 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
from conans import ConanFile, CMake, tools
from conans.errors import ConanException
class PistacheConan(ConanFile):
name = "pistache"
version = "d5608a1"
license = "Apache License 2.0"
url = "https://github.com/conan-community/conan-pistache.git"
description = "A high-performance REST Toolkit written in C++"
settings = "os", "compiler", "build_type", "arch"
options = {"shared": [True, False], "fPIC": [True, False]}
default_options = "shared=False", "fPIC=True"
generators = "cmake"
@property
def src_folder(self):
return "{}-{}".format(self.name, self.version)
def configure(self):
self.output.warn("[DEPRECATED] Package {}/{}@{}/{} is being deprecated. Change yours to require pistache/cci.20201127 instead"
.format(self.name, self.version, self.user, self.channel)
if self.settings.os != "Linux":
raise ConanException("Only Linux supported")
def source(self):
git = tools.Git(folder=self.src_folder)
git.clone("https://github.com/oktal/pistache.git", "master")
git.checkout(element=self.version)
tools.replace_in_file(os.path.join(self.src_folder, 'CMakeLists.txt'), 'project (pistache)',
"""project (pistache)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
""")
def build(self):
cmake = CMake(self)
cmake.definitions["PISTACHE_BUILD_TESTS"] = False
cmake.definitions["PISTACHE_BUILD_EXAMPLES"] = False
cmake.configure(source_folder=self.src_folder)
cmake.build()
def package(self):
cmake = CMake(self)
cmake.install()
def package_info(self):
self.cpp_info.libs = ["pistache", "atomic", ]
self.cpp_info.cppflags = ["-pthread", ]