conanfile.py 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. from conans import ConanFile, CMake, tools
  2. import os
  3. class QtProtobufConan(ConanFile):
  4. name = "qtprotobuf"
  5. version = "0.6.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.15.2",
  22. ]
  23. scm = {
  24. "type": "git",
  25. "url": "auto",
  26. "revision": "auto",
  27. }
  28. exports_sources = "*"
  29. def _configure_cmake(self):
  30. cmake = CMake(self)
  31. cmake.definitions["QT_PROTOBUF_MAKE_EXAMPLES"] = "OFF"
  32. cmake.definitions["QT_PROTOBUF_MAKE_TESTS"] = "OFF"
  33. cmake.configure()
  34. return cmake
  35. def build(self):
  36. cmake = self._configure_cmake()
  37. cmake.build()
  38. cmake.install()
  39. def package(self):
  40. cmake = self._configure_cmake()
  41. cmake.configure()
  42. cmake.install()
  43. self.copy("LICENSE", dst="licenses")