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]} default_options = {"shared": True} 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" else: self.output.info("Building static library.") cmake.configure() 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("*.hpp", dst="include/Arbutils", 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 package_info(self): self.cpp_info.libs = ["Arbutils"]