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
qtp0002.qdoc
Go to the documentation of this file.
1
// Copyright (C) 2023 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4
/*!
5
\page qt-cmake-policy-qtp0002.html
6
\ingroup qt-cmake-policies
7
8
\title QTP0002
9
\keyword qt_cmake_policy_qtp0002
10
11
\summary {Target properties that specify Android-specific paths may contain generator expressions.}
12
13
This policy was introduced in Qt 6.6. It changes the processing of target
14
properties that specify Android-specific paths:
15
\list
16
\li \l QT_QML_IMPORT_PATH
17
\li \l QT_QML_ROOT_PATH
18
\li \l QT_ANDROID_PACKAGE_SOURCE_DIR
19
\li \l QT_ANDROID_EXTRA_PLUGINS
20
\li \l QT_ANDROID_EXTRA_LIBS
21
\endlist
22
23
The \c OLD behavior of this policy doesn't allow generator expressions in the
24
target properties that specify Android-specific paths but implicitly converts
25
the specified paths to valid JSON strings.
26
27
The \c NEW behavior of this policy allows using generator expressions in the
28
target properties that specify Android-specific paths, but they must evaluate to
29
valid JSON strings.
30
31
The following value of the \l QT_ANDROID_EXTRA_PLUGINS property is converted to
32
a valid JSON string if you set the policy to OLD, but leads to an error if the
33
policy is set to NEW:
34
\badcode
35
set_target_properties(
36
QT_ANDROID_EXTRA_PLUGINS "\\path\\to\\MyPlugin.so"
37
)
38
\endcode
39
If the policy is set to NEW for the above example, the resulting JSON string in
40
the deployment settings file will contain escaped symbols instead of path
41
separators.
42
43
Generator expressions are only supported if the policy is set to NEW, so the
44
OLD behavior generates a malformed deployment settings file with the following
45
code:
46
\badcode
47
set_target_properties(
48
QT_ANDROID_EXTRA_PLUGINS "$<TARGET_FILE_DIR:MyPlugin>"
49
)
50
\endcode
51
52
This property value works as expected with both OLD and NEW policy values:
53
\badcode
54
set_target_properties(
55
QT_ANDROID_EXTRA_PLUGINS "/path/to/MyPlugin.so"
56
)
57
\endcode
58
59
\qtpolicydeprecatedbehavior
60
61
\sa qt_policy, {Qt CMake policies}
62
63
*/
qtbase
src
corelib
doc
src
cmake
policy
qtp0002.qdoc
Generated on
for Qt by
1.14.0