qt_add_win_app_sdk
Adds the Windows App SDK library to the application.
This command was introduced in Qt 6.9.
Note: This command is in technology preview and may change in future releases.
Synopsis
qt_add_win_app_sdk(<TARGET>)
Since 6.10:
qt_add_win_app_sdk(<TARGET> [<PROPAGATION>])
If versionless commands are disabled, use qt6_add_win_app_sdk()
instead. It supports the same set of arguments as this command.
Description
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:
- Tries to find the Windows App SDK and cppwinrt.exe tool
- Generates Windows App SDK headers using the cppwinrt.exe tool
- Includes those header files and links the library to the given CMake target
Arguments
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:
- target_include_directories()
- target_link_directories()
- 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:
- 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.
- PUBLIC: The settings are applied to the current target and are also propagated to any target that links against it. Use this when the dependency is required both for building the target and for its consumers.
- 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.
Notes
- This argument is optional.
- If omitted, the default behavior is equivalent to PRIVATE (or specify your actual default).
- Use the appropriate propagation scope to accurately describe your target’s dependencies and usage requirements.
Warning: This command is not supported on non-MSVC platforms.
© 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.