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() 创建构建步骤,以便在一个或多个 Wayland 协议文件上运行waylandscanner
和qtwaylandscanner
。这些工具将反过来生成实现协议的 C 和 C++ 绑定代码,生成的文件将作为target
的一部分进行构建。
PUBLIC_CODE
和PRIVATE_CODE
选项(在 Qt XML 6.8 中添加)与wayland-scanner
的public-code
和private-code
选项相对应。为了向后兼容,默认使用PUBLIC_CODE
,但一般强烈建议使用PRIVATE_CODE
。
qt_generate_wayland_protocol_server_sources()将触发生成实现协议合成器端所需的文件。
© 2025 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.