from conans import ConanFile, CMake class CreatureLibConan(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" options = {"shared": [True, False], "staticC": [True, False], "level_size": [8, 16, 32, 64]} default_options = {"shared": True, "staticC": False, "level_size": 8} 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" if self.options.shared: self.output.info("Building shared library.") cmake.definitions["SHARED"] = "On" if self.options.staticC: self.output.info("Linking C libraries statically") cmake.definitions["STATICC"] = "ON" self.output.info("Using level size of: %s" % self.options.level_size) cmake.definitions["LEVEL_SIZE"] = self.options.level_size cmake.configure() cmake.build() def package(self): self.copy("*.hpp", dst="include/CreatureLib", src="src") self.copy("*.hxx", dst="include/CreatureLib", src="src") self.copy("*.dll", dst="bin", keep_path=False) self.copy("*.so", dst="lib", keep_path=False) self.copy("*.a", dst="lib", keep_path=False) def imports(self): if self.settings.os == "Windows": self.copy("*.dll", "", "bin") self.copy("*.a", "", "bin") def package_info(self): self.cpp_info.libs = ["CreatureLib"] def requirements(self): self.requires("Arbutils/latest@epsilon/master")