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

qt_internal_add_test(tst_protobuf_nestedtypes
    SOURCES
        nestedtypes.cpp
    INCLUDE_DIRECTORIES
        ../../shared
    LIBRARIES
        Qt::Test
        Qt::Protobuf
)

qt6_protobuf_generate(TARGET tst_protobuf_nestedtypes
    PROTO_FILES
        proto/nestedmessages.proto
        proto/externalpackage.proto
    ${extra_generator_args}
    FIELDENUM
    OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/qt_protobuf_generated"
)

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