unset(extra_generator_args)
if(TARGET Qt::Qml)
    list(APPEND extra_generator_args QML)
endif()

qt6_protobuf_generate(GENERATED_TARGET tst_protobuf_enumtypes_gen
    PROTO_FILES
        enummessages.proto
    FIELDENUM
    ${extra_generator_args}
    OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/qt_protobuf_generated"
)

qt_internal_add_test(tst_protobuf_enumtypes
    SOURCES
        enumtypes.cpp
    INCLUDE_DIRECTORIES
        ../../shared
    LIBRARIES
        Qt::Test
        Qt::Protobuf
)
_qt_internal_link_protobuf_objects(tst_protobuf_enumtypes
    tst_protobuf_enumtypes_gen
)

qt_internal_add_test(tst_protobuf_serialization_enumtypes
    SOURCES
        serializationenumtypes.cpp
    LIBRARIES
        Qt::Test
        Qt::Protobuf
)
_qt_internal_link_protobuf_objects(tst_protobuf_serialization_enumtypes
    tst_protobuf_enumtypes_gen
)

qt_internal_add_test(tst_protobuf_deserialization_enumtypes
    SOURCES
        deserializationenumtypes.cpp
    LIBRARIES
        Qt::Test
        Qt::Protobuf
)
_qt_internal_link_protobuf_objects(tst_protobuf_deserialization_enumtypes
    tst_protobuf_enumtypes_gen
)

#if(QT_FEATURE_protobuf_json_serializer)
add_subdirectory(json)
#endif()

if(TARGET Qt::QuickTest)
    add_subdirectory(qml)
endif()
