conanfile.py 970 B

123456789101112131415161718192021222324252627282930313233
  1. from conans import ConanFile, CMake, tools
  2. from os import path
  3. class NanoPbConan(ConanFile):
  4. name = "nanopb"
  5. version = "0.4.6-dev"
  6. license = "zlib"
  7. url = "https://jpa.kapsi.fi/nanopb/"
  8. description = "Protocol Buffers with small code size"
  9. settings = "os_build", "compiler", "build_type", "arch"
  10. generators = "cmake"
  11. exports = '*'
  12. options = {
  13. "fPIC": [True, False],
  14. }
  15. default_options = {
  16. "fPIC": True,
  17. }
  18. def configure(self):
  19. if self.settings.os_build == "Windows" and self.settings.compiler == "Visual Studio":
  20. del self.options.fPIC
  21. def build(self):
  22. cmake = CMake(self)
  23. cmake.configure(source_folder=path.join(self.source_folder, "conan-wrapper"))
  24. cmake.build()
  25. cmake.install()
  26. def package_info(self):
  27. self.cpp_info.includedirs = ["include"]
  28. self.cpp_info.libdirs = ["lib"]
  29. self.cpp_info.libs = ["protobuf-nanopb"]