-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconanfile.py
47 lines (37 loc) · 1.23 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
import re
from conans import ConanFile, CMake
from conans.tools import load, check_min_cppstd
def read_project_property(property):
try:
cmake_lists = load("CMakeLists.txt")
value = re.search(r"project\(.*{} \"(.*?)\".*?\)".format(property), cmake_lists, re.S).group(1)
return value.strip()
except:
return None
class CppGeoTileConan(ConanFile):
name = "cppGeoTile"
scm = {
"type": "git",
"url": "https://github.com/Murthy10/cppGeoTile.git",
"revision": "auto",
}
version = read_project_property("VERSION")
license = "MIT"
url = read_project_property("HOMEPAGE_URL")
description = read_project_property("DESCRIPTION")
settings = "arch", "build_type", "compiler", "os"
options = {"shared": [False, True]}
default_options = {"shared": False}
def _configure_cmake(self):
check_min_cppstd(self, 17, gnu_extensions=False)
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_info(self):
self.cpp_info.libs = ["GeoTile"]