conanfile.py 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. from conan import ConanFile
  2. from conan.tools.cmake import CMakeToolchain, CMake, cmake_layout, CMakeDeps
  3. class tsdbRecipe(ConanFile):
  4. name = "tsdb"
  5. version = "0.1.0"
  6. package_type = "library"
  7. # Optional metadata
  8. license = "<Put the package license here>"
  9. author = "<Put your name here> <And your email here>"
  10. url = "<Package recipe repository url here, for issues about the package>"
  11. description = "<Description of tsdb package here>"
  12. topics = ("<Put some tag here>", "<here>", "<and here>")
  13. # Binary configuration
  14. settings = "os", "compiler", "build_type", "arch"
  15. options = {"shared": [True, False], "fPIC": [True, False]}
  16. default_options = {"shared": False, "fPIC": True}
  17. # Sources are located in the same place as this recipe, copy them to the recipe
  18. exports_sources = "CMakeLists.txt", "src/*", "include/*"
  19. # generators = "CMakeDeps", "CMakeToolchain"
  20. def requirements(self):
  21. # self.requires("clickhouse-cpp/2.5.1")
  22. self.requires("clickhouse-cpp/2.5.1_patch1@apkipa")
  23. self.requires("spdlog/1.14.1")
  24. self.requires("yaml-cpp/0.8.0")
  25. self.requires("nlohmann_json/3.11.3")
  26. self.requires("fmt/10.2.1")
  27. self.requires("zstd/1.5.6")
  28. def config_options(self):
  29. if self.settings.os == "Windows":
  30. self.options.rm_safe("fPIC")
  31. def configure(self):
  32. if self.options.shared:
  33. self.options.rm_safe("fPIC")
  34. def layout(self):
  35. cmake_layout(self)
  36. def generate(self):
  37. deps = CMakeDeps(self)
  38. deps.generate()
  39. tc = CMakeToolchain(self)
  40. tc.generate()
  41. def build(self):
  42. cmake = CMake(self)
  43. cmake.configure()
  44. cmake.build()
  45. def package(self):
  46. cmake = CMake(self)
  47. cmake.install()
  48. def package_info(self):
  49. self.cpp_info.libs = ["tsdb"]