|
| 1 | +from conan import ConanFile |
| 2 | +from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps |
| 3 | + |
| 4 | + |
| 5 | +class cpputils2Recipe(ConanFile): |
| 6 | + name = "cpputils2" |
| 7 | + version = "1.0" |
| 8 | + #package_type = "library" |
| 9 | + |
| 10 | + # Optional metadata |
| 11 | + license = "MIT" |
| 12 | + author = "Yangosoft yangosoft@protonmail.com" |
| 13 | + url = "https://github.com/yangosoft/cpputils2" |
| 14 | + description = "Set of utils in C++23" |
| 15 | + topics = ("shared memory", "mutex", "futex", "memory", "shared") |
| 16 | + |
| 17 | + # Binary configuration |
| 18 | + settings = "os", "compiler", "build_type", "arch" |
| 19 | + options = {"shared": [True, False], "fPIC": [True, False]} |
| 20 | + default_options = {"shared": False, "fPIC": True} |
| 21 | + |
| 22 | + # Sources are located in the same place as this recipe, copy them to the recipe |
| 23 | + exports_sources = "CMakeLists.txt", "src/*", "include/*", "examples/*" |
| 24 | + |
| 25 | + #def config_options(self): |
| 26 | + #if self.settings.os == "Windows": |
| 27 | + #self.options.rm_safe("fPIC") |
| 28 | + |
| 29 | + #def configure(self): |
| 30 | + #if self.options.shared: |
| 31 | + #self.options.rm_safe("fPIC") |
| 32 | + |
| 33 | + #def layout(self): |
| 34 | + # cmake_layout(self) |
| 35 | + |
| 36 | + def generate(self): |
| 37 | + deps = CMakeDeps(self) |
| 38 | + deps.generate() |
| 39 | + tc = CMakeToolchain(self) |
| 40 | + tc.generate() |
| 41 | + |
| 42 | + def build(self): |
| 43 | + cmake = CMake(self) |
| 44 | + cmake.configure() |
| 45 | + cmake.build() |
| 46 | + |
| 47 | + def package(self): |
| 48 | + cmake = CMake(self) |
| 49 | + cmake.install() |
| 50 | + |
| 51 | + def package_info(self): |
| 52 | + #self.cpp_info.libs = ["cpputils2"] |
| 53 | + self.cpp_info.set_property("cmake_target_name", "CPPUTILS2::cpputils2") |
| 54 | + self.cpp_info.bindirs = [] |
| 55 | + self.cpp_info.libdirs = [] |
| 56 | + #self.cpp_info.set_property("cmake_find_mode", "none") |
| 57 | + |
0 commit comments