// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

//! [0]
\badcode
cmake_minimum_required(VERSION 3.16...3.22)
project(MyThings)

find_package(Qt6 REQUIRED COMPONENTS Protobuf)
qt_standard_project_setup()

qt_add_protobuf(MyMessages
    GENERATE_PACKAGE_SUBFOLDERS
    PROTO_FILES
        path/to/message.proto
        path/to/other_message.proto
    PROTO_INCLUDES
        /path/to/proto/include
)

qt_add_executable(MyApp main.cpp)

target_link_libraries(MyApp PRIVATE MyMessages)
\endcode

In the example above we generate a library called \c{MyMessages} which
contains the message types defined in the paths passed to the
\c{PROTO_FILES} option. We use the \c{GENERATE_PACKAGE_SUBFOLDERS} option
to generate a folder structure for the generated files. And the
\c{PROTO_INCLUDES} option tells protoc to look for dependencies/imports
in the specified directories.

We then create a target for an executable called \c{MyApp} which we link
to the \c{MyMessages} library.
//! [0]
