Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
13This policy was introduced in Qt 6.6. It changes the processing of target
14properties 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
23The \c OLD behavior of this policy doesn't allow generator expressions in the
24target properties that specify Android-specific paths but implicitly converts
25the specified paths to valid JSON strings.
26
27The \c NEW behavior of this policy allows using generator expressions in the
28target properties that specify Android-specific paths, but they must evaluate to
29valid JSON strings.
30
31The following value of the \l QT_ANDROID_EXTRA_PLUGINS property is converted to
32a valid JSON string if you set the policy to OLD, but leads to an error if the
33policy is set to NEW:
34\badcode
35set_target_properties(
36 QT_ANDROID_EXTRA_PLUGINS "\\path\\to\\MyPlugin.so"
37)
38\endcode
39If the policy is set to NEW for the above example, the resulting JSON string in
40the deployment settings file will contain escaped symbols instead of path
41separators.
42
43Generator expressions are only supported if the policy is set to NEW, so the
44OLD behavior generates a malformed deployment settings file with the following
45code:
46\badcode
47set_target_properties(
48 QT_ANDROID_EXTRA_PLUGINS "$<TARGET_FILE_DIR:MyPlugin>"
49)
50\endcode
51
52This property value works as expected with both OLD and NEW policy values:
53\badcode
54set_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*/