BundleUtilities: get_bundle_main_executable can't handle iOS app bundle structure
The get_bundle_main_executable
function, which is defined inside the BundleUtilities
module, can't handle the directory structure of an iOS application bundle.
function(get_bundle_main_executable bundle result_var)
set(result "error: '${bundle}/Contents/Info.plist' file does not exist")
if(EXISTS "${bundle}/Contents/Info.plist")
# [...]
else()
#
# More inclusive technique... (This one would work on Windows and Linux
# too, if a developer followed the typical Mac bundle naming convention...)
#
# If there is no Info.plist file, try to find an executable with the same
# base name as the .app directory:
#
endif()
set(${result_var} "${result}" PARENT_SCOPE)
endfunction()
It is expecting the Info.plist
file to be in a Contents
subdirectory. This is correct for Mac applications. However, Apple decided to change the structure for iOS application bundles. As documented here the Info.plist
file for iOS applications resides directly at the root of the application structure. get_bundle_main_executable
therefore can't locate the Info.plist
file and returns an error string.
This makes it impossible for several BundleUtilities
functions, such as fixup_bundle
, to work properly when given a path to the iOS application bundle.
Edited by Brad King