CreatureLib/conanfile.py

38 lines
1.3 KiB
Python
Raw Normal View History

2019-12-19 14:48:35 +00:00
from conans import ConanFile, CMake, tools
2019-12-19 13:22:44 +00:00
class HelloConan(ConanFile):
name = "CreatureLib"
license = "TODO"
url = "https://git.p-epsilon.com/Deukhoofd/CreatureLib"
description = "The core implementation for turn based battling using creatures."
settings = "os", "compiler", "build_type", "arch"
options = {"shared": [True, False]}
default_options = {"shared": False}
generators = "cmake"
exports_sources = "*"
2019-12-19 14:48:35 +00:00
def set_version(self):
git = tools.Git(folder=self.recipe_folder)
self.version = "%s_%s" % (git.get_branch(), git.get_revision())
2019-12-19 13:22:44 +00:00
def build(self):
cmake = CMake(self)
cmake.configure(source_folder=".")
cmake.build()
# Explicit way:
# self.run('cmake "%s/src" %s' % (self.source_folder, cmake.command_line))
# self.run("cmake --build . %s" % cmake.build_config)
def package(self):
self.copy("*.h", dst="include", src="src")
self.copy("*.lib", dst="lib", keep_path=False)
self.copy("*.dll", dst="bin", keep_path=False)
self.copy("*.dylib*", dst="lib", keep_path=False)
self.copy("*.so", dst="lib", keep_path=False)
self.copy("*.a", dst="lib", keep_path=False)
def package_info(self):
self.cpp_info.libs = ["hello"]