CMakeLists.txt 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. if(QT_PROTOBUF_STANDALONE_TESTS)
  2. find_package(QtProtobuf COMPONENTS Protobuf ProtobufGenerator
  3. OPTIONAL_COMPONENTS Grpc ProtobufWellKnownTypes ProtobufQtTypes REQUIRED
  4. )
  5. endif()
  6. include(QtProtobufTestHelpers)
  7. add_subdirectory("test_protobuf")
  8. if(TARGET ${QT_VERSIONED_PREFIX}::QuickTest)
  9. add_subdirectory("test_qml")
  10. endif()
  11. add_subdirectory("test_protobuf_multifile")
  12. add_subdirectory("test_extra_namespace")
  13. if(NOT QT_PROTOBUF_STANDALONE_TESTS) # Disable in standalone mode as it requires some private
  14. # headers to work properly.
  15. add_subdirectory("test_extra_namespace_qml")
  16. add_subdirectory("test_qprotobuf_serializer_plugin")
  17. endif()
  18. if(TARGET ${QT_PROTOBUF_NAMESPACE}::ProtobufWellKnownTypes)
  19. add_subdirectory("test_wellknowntypes")
  20. endif()
  21. if(TARGET ${QT_PROTOBUF_NAMESPACE}::ProtobufQtTypes)
  22. add_subdirectory("test_qttypes")
  23. endif()
  24. if(WrapgRPC_FOUND AND TARGET ${QT_PROTOBUF_NAMESPACE}::Grpc)
  25. if(UNIX)
  26. set(TEST_DRIVER_NAME "test_driver.sh")
  27. elseif(WIN32)
  28. set(TEST_DRIVER_NAME "test_driver.bat")
  29. endif()
  30. add_subdirectory("test_grpc")
  31. if(TARGET ${QT_VERSIONED_PREFIX}::QuickTest)
  32. add_subdirectory("test_grpc_qml")
  33. endif()
  34. else()
  35. message(WARNING "gRPC not found: some tests cannot be built.")
  36. endif()