CMakeLists.txt 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. unset(extra_generator_args)
  2. if(TARGET Qt::Qml)
  3. list(APPEND extra_generator_args QML)
  4. endif()
  5. qt6_protobuf_generate(GENERATED_TARGET tst_protobuf_enumtypes_gen
  6. PROTO_FILES
  7. enummessages.proto
  8. FIELDENUM
  9. ${extra_generator_args}
  10. OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/qt_protobuf_generated"
  11. )
  12. qt_internal_add_test(tst_protobuf_enumtypes
  13. SOURCES
  14. enumtypes.cpp
  15. INCLUDE_DIRECTORIES
  16. ../../shared
  17. LIBRARIES
  18. Qt::Test
  19. Qt::Protobuf
  20. )
  21. _qt_internal_link_protobuf_objects(tst_protobuf_enumtypes
  22. tst_protobuf_enumtypes_gen
  23. )
  24. qt_internal_add_test(tst_protobuf_serialization_enumtypes
  25. SOURCES
  26. serializationenumtypes.cpp
  27. LIBRARIES
  28. Qt::Test
  29. Qt::Protobuf
  30. )
  31. _qt_internal_link_protobuf_objects(tst_protobuf_serialization_enumtypes
  32. tst_protobuf_enumtypes_gen
  33. )
  34. qt_internal_add_test(tst_protobuf_deserialization_enumtypes
  35. SOURCES
  36. deserializationenumtypes.cpp
  37. LIBRARIES
  38. Qt::Test
  39. Qt::Protobuf
  40. )
  41. _qt_internal_link_protobuf_objects(tst_protobuf_deserialization_enumtypes
  42. tst_protobuf_enumtypes_gen
  43. )
  44. #if(QT_FEATURE_protobuf_json_serializer)
  45. add_subdirectory(json)
  46. #endif()
  47. if(TARGET Qt::QuickTest)
  48. add_subdirectory(qml)
  49. endif()