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 4d838dae5a

Pick-to: 6.1 6.2
Task-number: QTBUG-95838
Change-Id: I3a7241528590ae3e9986cfa1f3e91ac983ef54f6
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
bb10
Alexandru Croitor 2021-08-20 14:27:25 +02:00
parent abb19da572
commit 5a437d2590
1 changed files with 1 additions and 1 deletions

View File

@ -701,7 +701,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()