Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qt_generate_wayland_protocol_client_sources.qdoc
Go to the documentation of this file.
1// Copyright (C) 2024 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4/*!
5\page qt-generate-wayland-protocol-client-sources.html
6\ingroup cmake-commands-qtwaylandclient
7
8\title qt_generate_wayland_protocol_client_sources
9\keyword qt6_generate_wayland_protocol_client_sources
10
11\summary {Generates client-side C++ bindings for a Wayland protocol .XML file}
12
13\cmakecommandsince 6.0
14
15The command is defined in the \c WaylandClient component of the \c Qt6 package, which
16can be loaded like so:
17
18\badcode
19find_package(Qt6 REQUIRED COMPONENTS WaylandClient)
20\endcode
21
22\section1 Synopsis
23
24\badcode
25qt_generate_wayland_protocol_client_sources(target
26 [PUBLIC_CODE | PRIVATE_CODE]
27 FILES file1.xml [file2.xml ...])
28\endcode
29
30\versionlessCMakeCommandsNote qt6_generate_wayland_protocol_client_sources()
31
32\section1 Description
33
34qt_generate_wayland_protocol_client_sources() creates the build steps to run \c{wayland-scanner} and
35\c{qtwaylandscanner} on one or more Wayland protocol files. The tools will in turn generate binding
36code in C and C++ for implementing the protocols, and the resulting files will be built as part
37of the \c target.
38
39The options \c{PUBLIC_CODE} and \c{PRIVATE_CODE} correspond to the \c{public-code} and
40\c{private-code} options of \c{wayland-scanner}. \c{PUBLIC_CODE} will cause the symbols in the
41code that is generated by \c{wayland-scanner} to be exported. For backwards compatibility \c{PUBLIC_CODE} is the
42default but generally \c{PRIVATE_CODE} is strongly recommended.
43
44qt_generate_wayland_protocol_client_sources() will trigger generation of the files needed to
45implement the client side of the protocol. \l{qt_generate_wayland_protocol_server_sources}{qt_generate_wayland_protocol_server_sources()}
46is the equivalent function for the compositor.
47
48See the \l{Custom Shell} or \l{Custom Extension} examples for a demonstration of how to use these
49functions.
50*/
51