qt_add_win_app_sdk
为应用程序添加 Windows App SDK 库。
此命令在 Qt 6.9 中引入。
注意: 此命令为技术预览版,在未来版本中可能会有所更改。
简介
qt_add_win_app_sdk(target)
如果禁用了无版本命令,请使用qt6_add_win_app_sdk()
代替。它支持与此命令相同的参数集。
说明
将 Windows App SDK 包含文件添加到项目中,并将必要的库链接到给定的 CMake 目标。Windows App SDK 以NuGet软件包的形式提供,因此可在托管应用程序中轻松使用。不过,对于非托管的 C++ 应用程序,我们需要头文件。该函数的操作步骤如下
- 尝试查找 Windows App SDK 和 cppwinrt.exe 工具
- 使用 cppwinrt.exe 工具生成 Windows 应用程序 SDK 头文件
- 包含这些头文件并将库链接到给定的 CMake 目标
警告: 非 MSVC 平台不支持此命令。
© 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.