-
Notifications
You must be signed in to change notification settings - Fork 0
/
conanfile.py
executable file
·57 lines (47 loc) · 1.87 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from conans import ConanFile, CMake, tools
import os
class RocketMQConan(ConanFile):
name = "rocketmq"
version = "1.2.2"
description = "Apache RocketMQ cpp client https://rocketmq.apache.org/"
topics = ("conan", "RocketMQ", "communication", "messaging")
url = "https://github.com/zinnion/conan-rocketmq"
homepage = "https://github.com/apache/rocketmq-client-cpp"
author = "Zinnion <mauro@zinnion.com>"
license = "MIT"
exports = ["LICENSE.md"]
exports_sources = ["CMakeLists.txt"]
settings = "os", "compiler", "build_type", "arch"
short_paths = True
generators = "cmake"
source_subfolder = "source_subfolder"
build_subfolder = "build_subfolder"
def requirements(self):
self.requires.add("boost/1.70.0@zinnion/stable")
def source(self):
tools.get("{0}/archive/{1}.tar.gz".format(self.homepage, self.version))
extracted_dir = "rocketmq-client-cpp-" + self.version
os.rename(extracted_dir, self.source_subfolder)
def configure(self):
del self.settings.compiler.libcxx
def configure_cmake(self):
cmake = CMake(self)
cmake.configure(source_folder=self.source_subfolder, build_folder=self.build_subfolder)
return cmake
def build(self):
cmake = self.configure_cmake()
cmake.build()
def package(self):
self.copy(pattern="LICENSE.txt", dst="license", src=self.source_subfolder)
cmake = self.configure_cmake()
cmake.install()
def package_info(self):
self.cpp_info.libs = tools.collect_libs(self)
if self.settings.os == "Windows":
if not self.options.shared:
self.cpp_info.libs.append('mswsock')
self.cpp_info.libs.append('ws2_32')
elif self.settings.os == "Linux":
self.cpp_info.libs.append('pthread')