This repository has been archived by the owner on Sep 25, 2021. It is now read-only.
forked from DEGoodmanWilson/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
conanfile.py
51 lines (43 loc) · 2.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
48
49
50
51
from conans import ConanFile, CMake
from conans.tools import os_info
class EngineConan(ConanFile):
name = "engine"
version = "1.0-beta26"
url = "https://github.com/DEGoodmanWilson/engine.git"
license = "MIT"
settings = "os", "compiler", "build_type", "arch"
requires = "cpr/1.2.0@DEGoodmanWilson/testing", "jsoncpp/1.7.3@theirix/stable"
options = {"build_engine_tests": [True, False],
"build_engine_coverage": [True, False],
"build_engine_examples": [True, False]}
default_options = "build_engine_tests=False", "build_engine_coverage=False", "build_engine_examples=False", "cpr:use_system_curl=True"
generators = "cmake"
exports = ["*"]
def config(self):
if self.options.build_engine_coverage:
self.options.build_engine_tests=True
if self.options.build_engine_tests:
self.requires.add("gtest/1.7.0@lasote/stable", private=False)
self.options["gtest"].shared = False
self.requires.add("luna/2.9.0@DEGoodmanWilson/stable", private=False)
else:
if "gtest" in self.requires:
del self.requires["gtest"]
if "luna" in self.requires:
del self.require["luna"]
def build(self):
cmake = CMake(self.settings)
build_engine_tests = "-DBUILD_ENGINE_TESTS=ON" if self.options.build_engine_tests else "-DBUILD_ENGINE_TESTS=OFF"
build_engine_coverage = "-DBUILD_ENGINE_COVERAGE=ON" if self.options.build_engine_coverage else "-DBUILD_ENGINE_COVERAGE=OFF"
build_engine_examples = "-DBUILD_ENGINE_EXAMPLES=ON" if self.options.build_engine_examples else "-DBUILD_ENGINE_EXAMPLES=OFF"
self.run('cmake %s %s %s %s' % (build_engine_tests, build_engine_coverage, build_engine_examples, cmake.command_line))
self.run('cmake --build . %s' % cmake.build_config)
def package(self):
self.copy("*.h", dst="include/slack", src="slack")
self.copy("*.hpp", dst="include/slack", src="slack")
self.copy("*.lib", dst="lib", src="lib")
self.copy("*.a", dst="lib", src="lib")
def package_info(self):
self.cpp_info.libs = ["engine"]
if os_info.is_linux:
self.cpp_info.libs.append("pthread")