conanfile.py 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. "microjson/0.1.0@semlanik/stable",
  23. ]
  24. scm = {
  25. "type": "git",
  26. "url": "auto",
  27. "revision": "auto",
  28. }
  29. exports_sources = "*"
  30. def _configure_cmake(self):
  31. cmake = CMake(self)
  32. cmake.definitions["QT_PROTOBUF_MAKE_EXAMPLES"] = "OFF"
  33. cmake.definitions["QT_PROTOBUF_MAKE_TESTS"] = "OFF"
  34. cmake.configure()
  35. return cmake
  36. def build(self):
  37. cmake = self._configure_cmake()
  38. cmake.build()
  39. cmake.install()
  40. def package(self):
  41. cmake = self._configure_cmake()
  42. cmake.configure()
  43. cmake.install()
  44. self.copy("LICENSE", dst="licenses")