forked from elsid/resource_pool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
conanfile.py
53 lines (41 loc) · 1.81 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
from conans import ConanFile, CMake
from conans.tools import load
import re
def get_version():
try:
content = load("CMakeLists.txt")
version = re.search(r"^\s*project\(resource_pool\s+VERSION\s+([^\s]+)", content, re.M).group(1)
return version.strip()
except Exception:
return None
class ResourcePool(ConanFile):
name = 'resource_pool'
version = get_version()
license = 'MIT'
url = 'https://github.com/elsid/resource_pool'
description = 'Conan package for elsid resource pool'
exports_sources = 'include/*', 'CMakeLists.txt', 'resource_poolConfig.cmake', 'LICENCE', 'AUTHORS'
generators = 'cmake_find_package'
requires = 'boost/1.74.0'
def _configure_cmake(self):
cmake = CMake(self)
cmake.configure()
return cmake
def build(self):
cmake = self._configure_cmake()
cmake.build()
def package(self):
cmake = self._configure_cmake()
cmake.install()
def package_id(self):
self.info.header_only()
def package_info(self):
self.cpp_info.components["_resource_pool"].includedirs = ["include"]
self.cpp_info.components["_resource_pool"].requires = ["boost::boost", "boost::system", "boost::thread"]
self.cpp_info.components["_resource_pool"].defines = ["BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT"]
self.cpp_info.filenames["cmake_find_package"] = "resource_pool"
self.cpp_info.filenames["cmake_find_package_multi"] = "resource_pool"
self.cpp_info.names["cmake_find_package"] = "elsid"
self.cpp_info.names["cmake_find_package_multi"] = "elsid"
self.cpp_info.components["_resource_pool"].names["cmake_find_package"] = "resource_pool"
self.cpp_info.components["_resource_pool"].names["cmake_find_package_multi"] = "resource_pool"