dependencies.cmake 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. set(QT_PROTOBUF_INSTALL TRUE)
  2. if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/grpc/CMakeLists.txt")
  3. message(STATUS "Found gRPC sub-project. Perform all-in-one build.")
  4. set(QT_PROTOBUF_INSTALL FALSE)
  5. set(gRPC_BUILD_TESTS FALSE)
  6. set(protobuf_BUILD_TESTS FALSE)
  7. add_subdirectory("3rdparty/grpc" EXCLUDE_FROM_ALL)
  8. if(TARGET grpc AND TARGET grpc++ AND TARGET grpc_cpp_plugin)
  9. add_library(gRPC::grpc ALIAS grpc)
  10. add_library(gRPC::grpc++ ALIAS grpc++)
  11. add_executable(gRPC::grpc_cpp_plugin ALIAS grpc_cpp_plugin)
  12. if (QT_PROTOBUF_NATIVE_GRPC_CHANNEL)
  13. export(TARGETS grpc++ grpc gpr NAMESPACE gRPC:: FILE gRPCTargets.cmake)
  14. export(TARGETS ssl crypto zlibstatic c-ares address_sorting FILE gRPCDepsTargets.cmake)
  15. endif()
  16. set(gRPC_FOUND TRUE)
  17. endif()
  18. else()
  19. include("${QT_PROTOBUF_CMAKE_DIR}/ProtobufLookup.cmake")
  20. include("${QT_PROTOBUF_CMAKE_DIR}/gRPCLookup.cmake")
  21. endif()
  22. if(NOT "${QT_PROTOBUF_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
  23. message(STATUS "QtProtobuf configured as sub-project.")
  24. set(QT_PROTOBUF_INSTALL FALSE)
  25. endif()
  26. if(NOT QT_PROTOBUF_INSTALL)
  27. message(STATUS "All install rules are disabled.")
  28. endif()