conanfile.py 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. self.requires("sole/1.0.4")
  29. def config_options(self):
  30. if self.settings.os == "Windows":
  31. self.options.rm_safe("fPIC")
  32. def configure(self):
  33. if self.options.shared:
  34. self.options.rm_safe("fPIC")
  35. self.options["fmt/*"].header_only = True
  36. self.options["spdlog/*"].header_only = True
  37. def layout(self):
  38. cmake_layout(self)
  39. def generate(self):
  40. deps = CMakeDeps(self)
  41. deps.generate()
  42. tc = CMakeToolchain(self)
  43. tc.generate()
  44. def build(self):
  45. cmake = CMake(self)
  46. cmake.configure()
  47. cmake.build()
  48. def package(self):
  49. cmake = CMake(self)
  50. cmake.install()
  51. def package_info(self):
  52. self.cpp_info.libs = ["tsdb"]