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