Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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
The command is defined in the \c WaylandClient component of the \c Qt6 package, which
14
can be loaded like so:
15
16
\badcode
17
find_package(Qt6 REQUIRED COMPONENTS WaylandClient)
18
\endcode
19
20
\cmakecommandsince 6.0
21
22
\section1 Synopsis
23
24
\badcode
25
qt_generate_wayland_protocol_client_sources(target
26
[PUBLIC_CODE | PRIVATE_CODE]
27
[NO_INCLUDE_CORE_ONLY]
28
FILES file1.xml [file2.xml ...])
29
\endcode
30
31
\versionlessCMakeCommandsNote qt6_generate_wayland_protocol_client_sources()
32
33
\section1 Description
34
35
qt_generate_wayland_protocol_client_sources() creates the build steps to run \c{wayland-scanner} and
36
\c{qtwaylandscanner} on one or more Wayland protocol files. The tools will in turn generate binding
37
code in C and C++ for implementing the protocols, and the resulting files will be built as part
38
of the \c target.
39
40
The options \c{PUBLIC_CODE} and \c{PRIVATE_CODE} (added in Qt 6.8) correspond to the \c{public-code}
41
and \c{private-code} options of \c{wayland-scanner}. \c{PUBLIC_CODE} will cause the symbols in the
42
code that is generated by \c{wayland-scanner} to be exported. For backwards compatibility \c{PUBLIC_CODE} is the
43
default but generally \c{PRIVATE_CODE} is strongly recommended.
44
45
By default, \c{wayland-scanner} is invoked with the \c{--include-core-only} argument, ensuring
46
that generated code includes \c{"wayland-client-core.h"}. This behavior can be disabled using
47
the \c{NO_INCLUDE_CORE_ONLY} option, which switches the include to \c{"wayland-client.h"}.
48
49
\note Using \c{NO_INCLUDE_CORE_ONLY} is generally discouraged. \c{"wayland-client.h"}
50
includes a pre-compiled version of the core Wayland protocol which may conflict with
51
newer protocol versions or other headers (like older versions of Vulkan). Only use
52
this option if you have a specific requirement for types not present in the core header
53
and are aware of the potential build-time conflicts.
54
55
qt_generate_wayland_protocol_client_sources() will trigger generation of the files needed to
56
implement the client side of the protocol. \l{qt_generate_wayland_protocol_server_sources}{qt_generate_wayland_protocol_server_sources()}
57
is the equivalent function for the compositor.
58
59
See the \l{Custom Shell} or \l{Custom Extension} examples for a demonstration of how to use these
60
functions.
61
*/
qtbase
src
plugins
platforms
wayland
doc
src
cmake
qt_generate_wayland_protocol_client_sources.qdoc
Generated on
for Qt by
1.16.1