CMake: Fix automatic iOS bundle id extraction

If no Xcode preferences file was found,
_qt_internal_get_ios_bundle_identifier_prefix accidentally assigned
the error output of running PlistBuddy to the bundle id property.

That resulted in a bundle id called
'${team_id}.Doesn't Exist, Will Create: /Users/qt/Library/Preferences/com.apple.dt.Xcode.plist\n.app'

Check that the error variable is empty before assigning.

Amends 4d838dae5a821e9e5f013ba1d5a494ece1b5180e

Task-number: QTBUG-95838
Change-Id: I3a7241528590ae3e9986cfa1f3e91ac983ef54f6
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 5a437d2590765a80236efad82e79654ebb3b4469)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Alexandru Croitor 2021-08-20 14:27:25 +02:00 committed by Qt Cherry-pick Bot
parent dfb1f8d293
commit aaa79cf735

View File

@ -661,7 +661,7 @@ function(_qt_internal_get_ios_bundle_identifier_prefix out_var)
message(DEBUG "Failed to extract the default bundle indentifier prefix.")
endif()
if(prefix)
if(prefix AND NOT prefix_error)
set_property(GLOBAL PROPERTY _qt_internal_ios_bundle_identifier_prefix "${prefix}")
set("${out_var}" "${prefix}" PARENT_SCOPE)
endif()