CMake: Only write device prefix to target_qt.conf if necessary

The device prefix in target_qt.conf is necessary if and only if the
prefix on the host is different from the prefix on the device - in CMake
terms: if CMAKE_STAGING_PREFIX is different from CMAKE_INSTALL_PREFIX.

This removes the [Devices] section from target_qt.conf from our iOS and
Android packages, because we don't set CMAKE_STAGING_PREFIX for those
platforms.

Pick-to: 6.2
Fixes: QTBUG-96906
Change-Id: I1390e952e544e57d5dd3bc09d688a612db9b4247
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Joerg Bornemann 2021-09-27 20:38:48 +02:00
parent fea1d57c2b
commit acde9784ca

View File

@ -122,9 +122,11 @@ function(qt_generate_qmake_wrapper_for_target)
set(sysrootify_prefix true)
else()
set(sysrootify_prefix false)
string(APPEND content "[DevicePaths]
if(NOT ext_prefix STREQUAL prefix)
string(APPEND content "[DevicePaths]
Prefix=${prefix}
")
endif()
endif()
string(APPEND content