from conans import ConanFile, CMake, tools import os class Bento4Conan(ConanFile): name = "Bento4" version = "1.5.1-629" license = "GPL-2.0-or-later" author = "Shawn Morford " url = "https://code.darkmorford.net/conan-pkg/Bento4" description = ("A fast, modern, open source C++ toolkit for all " "your MP4 and MPEG DASH media format needs.") homepage = "https://www.bento4.com/" topics = ("media", "container") settings = "os", "compiler", "build_type", "arch" options = {"shared": [True, False]} default_options = {"shared": False} generators = "cmake" @property def subfolder(self): return os.path.join(self.source_folder, "bento4") def source(self): self.output.info(f"Downloading source for version {self.version}") tools.get(**self.conan_data["sources"][self.version], destination="bento4") def build(self): cmake = CMake(self) cmake.configure(source_folder="hello") cmake.build() # Explicit way: # self.run('cmake %s/hello %s' # % (self.source_folder, cmake.command_line)) # self.run("cmake --build . %s" % cmake.build_config) def package(self): self.copy("*.h", dst="include", src="hello") self.copy("*hello.lib", dst="lib", keep_path=False) self.copy("*.dll", dst="bin", keep_path=False) self.copy("*.so", dst="lib", keep_path=False) self.copy("*.dylib", dst="lib", keep_path=False) self.copy("*.a", dst="lib", keep_path=False) def package_info(self): self.cpp_info.libs = ["hello"]