first commit
This commit is contained in:
50
conanfile.py
Normal file
50
conanfile.py
Normal file
@@ -0,0 +1,50 @@
|
||||
from conan import ConanFile
|
||||
from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout
|
||||
|
||||
class XRabbitMQClientConan(ConanFile):
|
||||
name = "xrabbitmqclient"
|
||||
version = "1.0.0"
|
||||
description = "A C++ wrapper for RabbitMQ based on Interface and Pimpl."
|
||||
license = "MIT"
|
||||
author = "XDL"
|
||||
topics = ("rabbitmq", "amqp", "message-queue")
|
||||
settings = "os", "compiler", "build_type", "arch"
|
||||
|
||||
options = {"shared": [True, False], "fPIC": [True, False]}
|
||||
default_options = {"shared": False, "fPIC": True}
|
||||
|
||||
exports_sources = "CMakeLists.txt", "src/*", "include/*"
|
||||
|
||||
def config_options(self):
|
||||
if self.settings.os == "Windows":
|
||||
del self.options.fPIC
|
||||
|
||||
def configure(self):
|
||||
if self.options.shared:
|
||||
self.options.rm_safe("fPIC")
|
||||
|
||||
def layout(self):
|
||||
cmake_layout(self)
|
||||
|
||||
def requirements(self):
|
||||
self.requires("simpleamqpclient/2.5.1", transitive_headers=True, transitive_libs=True)
|
||||
self.requires("boost/1.78.0")
|
||||
|
||||
def generate(self):
|
||||
tc = CMakeToolchain(self)
|
||||
tc.generate()
|
||||
deps = CMakeDeps(self)
|
||||
deps.generate()
|
||||
|
||||
def build(self):
|
||||
cmake = CMake(self)
|
||||
cmake.configure()
|
||||
cmake.build()
|
||||
|
||||
def package(self):
|
||||
cmake = CMake(self)
|
||||
cmake.install()
|
||||
|
||||
def package_info(self):
|
||||
self.cpp_info.libs = ["xrabbitmqclient"]
|
||||
self.cpp_info.requires = ["simpleamqpclient::simpleamqpclient", "boost::boost"]
|
||||
Reference in New Issue
Block a user