conanfile.py 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. from conans import ConanFile, CMake, tools
  2. import os
  3. class QtProtobufConan(ConanFile):
  4. name = "qtprotobuf"
  5. version = "0.4.0"
  6. license = "MIT"
  7. url = "https://github.com/semlanik/qtprotobuf"
  8. description = ("gRPC and Protobuf generator and bindings for Qt framework")
  9. topics = ("conan", "qt", "protobuf")
  10. settings = "os", "compiler", "build_type", "arch"
  11. homepage = "https://github.com/semlanik/qtprotobuf"
  12. options = {"shared": [True, False]}
  13. default_options = {
  14. "shared": False,
  15. "qt:qtdeclarative": True,
  16. }
  17. generators = "cmake"
  18. requires = [
  19. "protobuf/3.9.1",
  20. "protoc_installer/3.9.1@bincrafters/stable",
  21. "qt/5.14.2@bincrafters/stable",
  22. "grpc/1.25.0@inexorgame/stable",
  23. "openssl/1.1.1d",
  24. ]
  25. scm = {
  26. "type": "git",
  27. "url": "auto",
  28. "revision": "auto",
  29. }
  30. exports_sources = "*"
  31. def _configure_cmake(self):
  32. cmake = CMake(self)
  33. cmake.definitions["QT_PROTOBUF_MAKE_EXAMPLES"] = "OFF"
  34. cmake.definitions["QT_PROTOBUF_MAKE_TESTS"] = "OFF"
  35. cmake.configure()
  36. return cmake
  37. def build(self):
  38. cmake = self._configure_cmake()
  39. cmake.build()
  40. cmake.install()
  41. def package(self):
  42. cmake = self._configure_cmake()
  43. cmake.configure()
  44. cmake.install()
  45. self.copy("LICENSE", dst="licenses")