qt_add_win_app_sdk

Adds the Windows App SDK library to the application.

This command was introduced in Qt 6.9.

注意: This command is in technology preview and may change in future releases.

概要

qt_add_win_app_sdk(<TARGET>)
					

Since 6.10:

qt_add_win_app_sdk(<TARGET> [<PROPAGATION>])
					

无版本命令 被禁用,使用 qt6_add_win_app_sdk() 代替。它支持如此命令的一组相同自变量。

描述

Adds Windows App SDK include files to the project, and links the necessary libraries to the given CMake target. Windows App SDK is provided as a NuGet package so it can be easily used in managed apps. However, for unmanaged C++ applications we need header files. The function takes the following steps:

  1. Tries to find the Windows App SDK and cppwinrt.exe tool
  2. Includes those header files and links the library to the given CMake target

自变量

PROPAGATION

Specifies the propagation visibility of include directories, link directories, and linked libraries for the target. This argument is passed directly to the following CMake commands:

  1. target_include_directories()
  2. target_link_libraries()

It determines how these properties are applied to the target itself and whether they are propagated to other targets that link against it.

Accepted values:

  1. PRIVATE: The settings (include directories, link directories, and linked libraries) are applied only to the current target. They are not visible to targets that link against this one.
  2. INTERFACE: The settings are not used when building the current target, but are propagated to targets that link against it. This is typically used for header-only libraries or interface targets that expose usage requirements without needing them for their own build.

注意事项

  1. This argument is optional.
  2. Use the appropriate propagation scope to accurately describe your target’s dependencies and usage requirements.

警告: This command is not supported on non-MSVC platforms.