-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconanfile.py
38 lines (32 loc) · 988 Bytes
/
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from conans import ConanFile, CMake, tools
import os
class NsGetoptConan(ConanFile):
name = "ns_getopt"
version = "1.0.0"
description = "Modern C++ argument parsing."
url = "https://github.com/p-groarke/ns_getopt"
license = "BSD3"
exports = ["LICENSE"]
exports_sources = ["CMakeLists.txt", "include/*", "tests/*", "cmake/*"]
generators = "cmake"
source_subfolder = "source_subfolder"
build_subfolder = "build_subfolder"
settings = "os", "arch", "compiler", "build_type"
requires = "catch2/2.2.2@bincrafters/stable"
options = {"build_testing": [True, False]}
default_options = ("build_testing=False")
def build(self):
cmake = CMake(self)
cmake.definitions["BUILD_TESTING"] = self.options.build_testing
cmake.configure()
cmake.build()
if self.options.build_testing:
cmake.test()
def package(self):
cmake = CMake(self)
cmake.configure()
cmake.install()
def package_info(self):
self.info.header_only()