qt_generate_wayland_protocol_server_sources
Waylandプロトコルの.XMLファイル用のサーバーサイドC++バインディングを生成します
このコマンドは、Qt6 パッケージのWaylandCompositor コンポーネントに定義されており、次のように読み込むことができます:
find_package(Qt6 REQUIRED COMPONENTS WaylandCompositor)このコマンドは Qt 6.0 で導入されました。
概要
qt_generate_wayland_protocol_server_sources(target
[PUBLIC_CODE | PRIVATE_CODE]
FILES file1.xml [file2.xml ...])バージョン指定なしのコマンドが無効になっている場合は、代わりに `qt6_generate_wayland_protocol_server_sources() ` を使用してください。このコマンドと同じ引数セットをサポートしています。
説明
qt_generate_wayland_protocol_server_sources() は、1つ以上のWaylandプロトコルファイルに対してwaylandscanner およびqtwaylandscanner を実行するためのビルド手順を作成します。これらのツールは、プロトコルを実装するためのCおよびC++のバインディングコードを生成し、生成されたファイルはtarget の一部としてビルドされます。
オプションPUBLIC_CODE およびPRIVATE_CODE (Qt 6.8 で追加)は、wayland-scanner のpublic-code およびprivate-code オプションに対応しています。
Qt 6.12 以前では、デフォルトは `PUBLIC_CODE` でした。Qt 6.12 以降では、Qt ポリシー `qt_cmake_policy_qtp0006` が `NEW` に設定されている場合、デフォルトは `PRIVATE_CODE ` になります。一般的には、`PRIVATE_CODE ` を強く推奨します。
qt_generate_wayland_protocol_server_sources() は、プロトコルのコンポジター側を実装するために必要なファイルの生成をトリガーします。
qt_generate_wayland_protocol_client_sources()は、クライアント側に対応する関数です。
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.