2019-12-19 15:09:02 +00:00
|
|
|
from conans import ConanFile, CMake
|
2019-12-19 13:22:44 +00:00
|
|
|
|
|
|
|
|
2019-12-19 15:49:47 +00:00
|
|
|
class CreatureLibConan(ConanFile):
|
2019-12-19 13:22:44 +00:00
|
|
|
name = "CreatureLib"
|
|
|
|
license = "TODO"
|
|
|
|
url = "https://git.p-epsilon.com/Deukhoofd/CreatureLib"
|
|
|
|
description = "The core implementation for turn based battling using creatures."
|
2020-01-01 13:32:54 +00:00
|
|
|
settings = "os", "compiler"
|
2020-05-03 10:45:12 +00:00
|
|
|
options = {"shared": [True, False], "staticC": [True, False]}
|
|
|
|
default_options = {"shared": True, "staticC": False}
|
2019-12-19 13:22:44 +00:00
|
|
|
generators = "cmake"
|
|
|
|
exports_sources = "*"
|
2019-12-21 13:32:45 +00:00
|
|
|
compiler = "clang"
|
2019-12-19 13:22:44 +00:00
|
|
|
|
|
|
|
def build(self):
|
|
|
|
cmake = CMake(self)
|
2020-01-01 13:17:13 +00:00
|
|
|
self.output.info("Target OS: %s." % self.settings.os)
|
|
|
|
if self.settings.os == "Windows":
|
2020-01-01 12:42:36 +00:00
|
|
|
self.output.warn("Noticed Windows target, setting Cmake WINDOWS=On.")
|
|
|
|
cmake.definitions["WINDOWS"] = "On"
|
2020-05-03 10:45:12 +00:00
|
|
|
if self.options.staticC:
|
|
|
|
self.output.info("Linking C libraries statically")
|
|
|
|
cmake.definitions["STATICC"] = "ON"
|
2019-12-19 15:49:47 +00:00
|
|
|
cmake.configure()
|
2019-12-19 13:22:44 +00:00
|
|
|
cmake.build()
|
|
|
|
|
|
|
|
def package(self):
|
2020-02-08 18:04:04 +00:00
|
|
|
self.copy("*.hpp", dst="include/CreatureLib", src="src")
|
2020-01-01 14:53:27 +00:00
|
|
|
self.copy("*.dll", dst="bin", keep_path=False)
|
|
|
|
self.copy("*.so", dst="lib", keep_path=False)
|
2020-05-02 13:55:31 +00:00
|
|
|
self.copy("*.a", dst="lib", keep_path=False)
|
2019-12-19 13:22:44 +00:00
|
|
|
|
2020-02-27 10:21:23 +00:00
|
|
|
def imports(self):
|
|
|
|
if self.settings.os == "Windows":
|
|
|
|
self.copy("*.dll", "bin", "bin")
|
2020-05-02 13:55:31 +00:00
|
|
|
self.copy("*.a", "bin", "bin")
|
2020-02-27 10:21:23 +00:00
|
|
|
|
2019-12-19 13:22:44 +00:00
|
|
|
def package_info(self):
|
2019-12-26 13:17:10 +00:00
|
|
|
self.cpp_info.libs = ["CreatureLibCore", "CreatureLibLibrary", "CreatureLibBattling"]
|
2020-02-26 12:51:16 +00:00
|
|
|
|
|
|
|
def requirements(self):
|
|
|
|
self.requires("Arbutils/latest@epsilon/master")
|