Avoid littering CMake logs with QTP0002 warnings

It doesn't make any sense to setup and get policy when we build either
Qt or standalone tests, since the value will be ignored anyway. So
skip the policy setup for Qt builds to avoid littering the CMake logs
with QTP0002 warnings.

Amends c4debab927

Change-Id: Iacae8f9ecbb6c9da2f3af77b2016454c8d4194e6
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Alexey Edelev 2023-05-09 14:45:46 +02:00
parent 798456c0a3
commit f71eb4a642

View File

@ -887,14 +887,17 @@ endfunction()
# It doesn't overwrite public properties, but instead writes formatted values to internal
# properties.
function(_qt_internal_android_format_deployment_paths target)
__qt_internal_setup_policy(QTP0002 "6.6.0"
"Target properties that specify android-specific paths may contain generator\
expressions but they must evaluate to valid JSON strings.\
Check https://doc.qt.io/qt-6/qt-cmake-policy-qtp0002.html for policy details."
)
qt6_policy(GET QTP0002 android_deployment_paths_policy)
if(QT_BUILD_STANDALONE_TESTS OR QT_BUILDING_QT OR
android_deployment_paths_policy STREQUAL "NEW")
if(QT_BUILD_STANDALONE_TESTS OR QT_BUILDING_QT)
set(android_deployment_paths_policy NEW)
else()
__qt_internal_setup_policy(QTP0002 "6.6.0"
"Target properties that specify android-specific paths may contain generator\
expressions but they must evaluate to valid JSON strings.\
Check https://doc.qt.io/qt-6/qt-cmake-policy-qtp0002.html for policy details."
)
qt6_policy(GET QTP0002 android_deployment_paths_policy)
endif()
if(android_deployment_paths_policy STREQUAL "NEW")
# When building standalone tests or Qt itself we obligate developers to not use
# windows paths when setting QT_* properties below, so their values are used as is when
# generating deployment settings.