Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qt_add_win_app_sdk.qdoc
Go to the documentation of this file.
1
// Copyright (C) 2024 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4
/*!
5
\page qt-add-win-app-sdk.html
6
\ingroup cmake-commands-qtcore
7
8
\title qt_add_win_app_sdk
9
\keyword qt6_add_win_app_sdk
10
11
\summary {Adds the Windows App SDK library to the application.}
12
13
\cmakecommandsince 6.9
14
\preliminarycmakecommand
15
16
\section1 Synopsis
17
18
\badcode
19
qt_add_win_app_sdk(<TARGET>)
20
\endcode
21
22
Since 6.10:
23
24
\badcode
25
qt_add_win_app_sdk(<TARGET> [<PROPAGATION>])
26
\endcode
27
28
\versionlessCMakeCommandsNote qt6_add_win_app_sdk()
29
30
\section1 Description
31
32
Adds Windows App SDK include files to the project, and links the necessary
33
libraries to the given CMake target. Windows App SDK is provided as
34
a \l{https://learn.microsoft.com/en-us/nuget/what-is-nuget}{NuGet}
35
package so it can be easily used in managed apps. However, for unmanaged
36
C++ applications we need header files.
37
The function takes the following steps:
38
\list 1
39
\li Tries to find the Windows App SDK and cppwinrt.exe tool
40
\li Generates Windows App SDK headers using the cppwinrt.exe tool
41
\li Includes those header files and links the library to the given CMake target
42
\endlist
43
44
\section1 Arguments
45
46
\c PROPAGATION
47
48
Specifies the propagation visibility of include directories, link directories, and linked libraries
49
for the target.
50
This argument is passed directly to the following CMake commands:
51
\list 1
52
\li target_include_directories()
53
\li target_link_directories()
54
\li target_link_libraries()
55
\endlist
56
57
It determines how these properties are applied to the target itself and whether they are propagated
58
to other targets that link against it.
59
\section2 Accepted values:
60
\list 1
61
\li PRIVATE:
62
The settings (include directories, link directories, and linked libraries) are applied only
63
to the current target. They are not visible to targets that link against this one.
64
\li PUBLIC:
65
The settings are applied to the current target and are also propagated to any target that
66
links against it. Use this when the dependency is required both for building the target and
67
for its consumers.
68
\li INTERFACE:
69
The settings are not used when building the current target, but are propagated to targets
70
that link against it. This is typically used for header-only libraries or interface targets
71
that expose usage requirements without needing them for their own build.
72
\endlist
73
74
\section2 Notes
75
\list 1
76
\li This argument is optional.
77
\li If omitted, the default behavior is equivalent to PRIVATE (or specify your actual default).
78
\li Use the appropriate propagation scope to accurately describe your target’s dependencies
79
and usage requirements.
80
\endlist
81
82
\warning This command is not supported on non-MSVC platforms.
83
*/
qtbase
src
corelib
doc
src
cmake
qt_add_win_app_sdk.qdoc
Generated on
for Qt by
1.14.0