CMakeLists.txt 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. qt_protobuf_internal_add_library(Grpc
  2. SOURCES
  3. qgrpcasyncoperationbase.cpp
  4. qgrpcasyncreply.cpp
  5. qgrpcsubscription.cpp
  6. qgrpcstatus.cpp
  7. qabstractgrpcchannel.cpp
  8. qgrpchttp2channel.cpp
  9. qabstractgrpcclient.cpp
  10. qgrpccredentials.cpp
  11. qgrpcsslcredentials.cpp
  12. qgrpcinsecurecredentials.cpp
  13. qgrpcuserpasswordcredentials.cpp
  14. PUBLIC_HEADER
  15. qgrpcasyncoperationbase_p.h
  16. qgrpcasyncreply.h
  17. qgrpcsubscription.h
  18. qgrpcstatus.h
  19. qabstractgrpcchannel.h
  20. qgrpchttp2channel.h
  21. qabstractgrpcclient.h
  22. qabstractgrpccredentials.h
  23. qgrpccredentials.h
  24. qgrpcsslcredentials.h
  25. qgrpcinsecurecredentials.h
  26. qgrpcuserpasswordcredentials.h
  27. qtgrpcglobal.h
  28. PUBLIC_LIBRARIES
  29. ${QT_PROTOBUF_NAMESPACE}::Protobuf
  30. Qt5::Core
  31. Qt5::Network
  32. )
  33. if(QT_PROTOBUF_NATIVE_GRPC_CHANNEL)
  34. qt_protobuf_internal_extend_target(Grpc
  35. SOURCES
  36. qgrpcchannel.cpp qgrpcchannel_p.h
  37. PUBLIC_HEADER
  38. qgrpcchannel.h
  39. PUBLIC_DEFINES
  40. QT_PROTOBUF_NATIVE_GRPC_CHANNEL
  41. PUBLIC_LIBRARIES
  42. gRPC::grpc++
  43. ${CMAKE_THREAD_LIBS_INIT}
  44. )
  45. endif()
  46. if(NOT BUILD_SHARED_LIBS)
  47. set(QT_PROTOBUF_EXTRA_CONFIG "staticlib") #extra config for .pri file in case if static build enabled
  48. endif()
  49. configure_file("${CMAKE_CURRENT_SOURCE_DIR}/qt_lib_grpc.pri.in"
  50. "${QT_PROTOBUF_BINARY_DIR}/qt_lib_grpc.pri" @ONLY
  51. )
  52. if(QT_PROTOBUF_INSTALL)
  53. qt_protobuf_extract_qt_variable(QT_HOST_DATA)
  54. install(FILES "${QT_PROTOBUF_BINARY_DIR}/qt_lib_grpc.pri"
  55. DESTINATION "${QT_HOST_DATA}/mkspecs/modules"
  56. COMPONENT dev
  57. )
  58. endif()
  59. if(TARGET Qt5::Quick)
  60. add_subdirectory("quick")
  61. endif()