1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-04-30 04:33:53 +00:00
CLI11/conanfile.py
Henry Schreiner 79a1847605
Overflow (#84)
* Overflowing an integer conversion now results in a conversion failure

* CMake improvements for VERSION and inital packing support

* Fix for recent addition of overflow check

* Conan file now gets version from Version.hpp file too
2018-03-10 09:50:25 +01:00

34 lines
1015 B
Python

from conans import ConanFile, CMake
from conans.tools import load
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 HelloConan(ConanFile):
name = "CLI11"
version = get_version()
url = "https://github.com/CLIUtils/CLI11"
settings = "os", "compiler", "arch", "build_type"
license = "BSD 3 clause"
description = "Command Line Interface toolkit for C++11"
exports_sources = "LICENSE", "README.md", "include/*", "cmake/*", "CMakeLists.txt", "tests/*"
def build(self): # this is not building a library, just tests
cmake = CMake(self)
cmake.definitions["CLI_EXAMPLES"] = "OFF"
cmake.definitions["CLI_SINGLE_FILE"] = "OFF"
cmake.configure()
cmake.build()
cmake.test()
cmake.install()
def package_id(self):
self.info.header_only()