Arbutils/conanfile.py

45 lines
1.6 KiB
Python
Raw Normal View History

2020-02-26 11:57:18 +00:00
from conans import ConanFile, CMake
class ArbutilsConan(ConanFile):
name = "Arbutils"
license = "TODO"
url = "https://git.p-epsilon.com/Deukhoofd/Arbutils"
description = "A helper library for the Epsilon project."
settings = "os", "compiler"
options = {"shared": [True, False], "staticC": [True, False]}
default_options = {"shared": True, "staticC": False}
2020-02-26 11:57:18 +00:00
generators = "cmake"
exports_sources = "*"
compiler = "clang"
def build(self):
cmake = CMake(self)
self.output.info("Target OS: %s." % self.settings.os)
if self.settings.os == "Windows":
self.output.warn("Noticed Windows target, setting Cmake WINDOWS=On.")
cmake.definitions["WINDOWS"] = "On"
2020-05-02 13:49:37 +00:00
if self.options.shared:
2020-05-02 10:31:04 +00:00
self.output.info("Building shared library.")
cmake.definitions["SHARED"] = "On"
else:
self.output.info("Building static library.")
if self.options.staticC:
self.output.info("Linking C libraries statically.")
cmake.definitions["STATICC"] = "On"
2020-02-26 11:57:18 +00:00
cmake.configure()
cmake.build()
def package(self):
self.copy("*.hpp", dst="include/Arbutils", src="src")
2020-09-25 10:46:20 +00:00
self.copy("*.hxx", dst="include/Arbutils", src="src")
self.copy("*.hpp", dst="include/extern", src="extern")
2020-02-26 11:57:18 +00:00
self.copy("*.dll", dst="bin", keep_path=False)
self.copy("*.so", dst="lib", keep_path=False)
2020-05-02 10:31:04 +00:00
self.copy("*.a", dst="lib", keep_path=False)
2020-02-26 11:57:18 +00:00
def package_info(self):
self.cpp_info.libs = ["Arbutils"]