forked from CLIUtils/CLI11
-
Notifications
You must be signed in to change notification settings - Fork 2
/
conanfile.py
48 lines (41 loc) · 1.32 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
from conans import ConanFile, CMake
from conans.tools import load, cross_building
import re
def get_version():
try:
content = load("include/CLI/Version.hpp")
version = re.search(r'#define CLI11_VERSION "(.*)"', content).group(1)
return version
except Exception:
return None
class CLI11Conan(ConanFile):
name = "CLI11"
version = get_version()
description = "Command Line Interface toolkit for C++11"
topics = ("cli", "c++11", "parser", "cli11")
url = "https://github.com/CLIUtils/CLI11"
homepage = "https://github.com/CLIUtils/CLI11"
author = "Henry Schreiner <[email protected]>"
license = "BSD-3-Clause"
settings = "os", "compiler", "arch", "build_type"
exports_sources = (
"LICENSE",
"README.md",
"include/*",
"extern/*",
"cmake/*",
"CMakeLists.txt",
"CLI11.CPack.Description.txt",
"tests/*",
)
def build(self): # this is not building a library, just tests
cmake = CMake(self)
cmake.definitions["CLI11_EXAMPLES"] = "OFF"
cmake.definitions["CLI11_SINGLE_FILE"] = "OFF"
cmake.configure()
cmake.build()
if not cross_building(self.settings):
cmake.test()
cmake.install()
def package_id(self):
self.info.header_only()