Xcode INSTALL_PATH setting is junk, resulting in corrupted archive bundles
When generating an Xcode project from my CMake tree, the dynamic library targets end up having an Installation Directory (INSTALL_PATH) setting of a junk value. When choosing the Archive build option, the dynamic libraries are copied to a directory literally named "@rpath" at the root of the .xcarchive bundle, which results in the bundle being considered invalid for distribution.
In my project, I need the INSTALL_PATH setting to be an empty string. This is because I include the dylib targets in an Application bundle target that has a manual copy step for the libraries into a Frameworks directory. Setting CMake vars INSTALL_NAME_DIR and CMAKE_XCODE_ATTRIBUTE_INSTALL_PATH has no effect on the value of INSTALL_PATH in the Xcode project.
Here's the relevant Xcode project configuration generated by CMake.
//:configuration = Release
INSTALL_PATH = @rpath
//:configuration = RelWithDebInfo
INSTALL_PATH = @rpath
//:configuration = Debug
INSTALL_PATH = @rpath
//:configuration = MinSizeRel
INSTALL_PATH = @rpath
//:completeSettings = some
INSTALL_PATH
Here's an example of how the corrupt bundle appears after building.
jeremy@Galactus ~/L/D/X/A/2/GroundControl Launchpad 6-7-18, 9.53 AM.xcarchive> find . -name "*.dylib"
./Products/Applications/GroundControl Launchpad.app/Contents/Resources/cbrxd/cbrxd Libs/Shell.dylib
./Products/Applications/GroundControl Launchpad.app/Contents/Resources/cbrxd/cbrxd Libs/rbframework.dylib
./Products/Applications/GroundControl Launchpad.app/Contents/Frameworks/libLetsMove.dylib
./Products/Applications/GroundControl Launchpad.app/Contents/Frameworks/libggcurl.dylib
./Products/Applications/GroundControl Launchpad.app/Contents/Frameworks/libpcProxAPI.dylib
./Products/Applications/GroundControl Launchpad.app/Contents/Frameworks/libGCPlatformCompatibility.dylib
./Products/Applications/GroundControl Launchpad.app/Contents/Frameworks/libGCImageBurner.dylib
./Products/Applications/GroundControl Launchpad.app/Contents/Frameworks/libusb-1.0.dylib
./Products/Applications/GroundControl Launchpad.app/Contents/Frameworks/libBackupTools.dylib
./Products/Applications/GroundControl Launchpad.app/Contents/Frameworks/libGCMath.dylib
./Products/Applications/GroundControl Launchpad.app/Contents/Frameworks/libusb++.dylib
./Products/Applications/GroundControl Launchpad.app/Contents/Frameworks/libGCNetwork.dylib
./Products/Applications/GroundControl Launchpad.app/Contents/Frameworks/libssl.1.1.dylib
./Products/Applications/GroundControl Launchpad.app/Contents/Frameworks/libGCServiceConfiguration.dylib
./Products/Applications/GroundControl Launchpad.app/Contents/Frameworks/libcbrx.dylib
./Products/Applications/GroundControl Launchpad.app/Contents/Frameworks/libGCSharedSupport.dylib
./Products/Applications/GroundControl Launchpad.app/Contents/Frameworks/libGCMessageService.dylib
./Products/Applications/GroundControl Launchpad.app/Contents/Frameworks/libGGDevice.dylib
./Products/Applications/GroundControl Launchpad.app/Contents/Frameworks/libCoreJSON.dylib
./Products/Applications/GroundControl Launchpad.app/Contents/Frameworks/libCF++.dylib
./Products/Applications/GroundControl Launchpad.app/Contents/Frameworks/libCFExtension.dylib
./Products/Applications/GroundControl Launchpad.app/Contents/Frameworks/libGroundControlUI.dylib
./Products/Applications/GroundControl Launchpad.app/Contents/Frameworks/libGCSmartHubService.dylib
./Products/Applications/GroundControl Launchpad.app/Contents/Frameworks/libGCLog.dylib
./Products/Applications/GroundControl Launchpad.app/Contents/Frameworks/libAppTools.dylib
./Products/Applications/GroundControl Launchpad.app/Contents/Frameworks/libGCTaskService.dylib
./Products/Applications/GroundControl Launchpad.app/Contents/Frameworks/libGCAssetDownloader.dylib
./Products/Applications/GroundControl Launchpad.app/Contents/Frameworks/libGCEncryption.dylib
./Products/Applications/GroundControl Launchpad.app/Contents/Frameworks/libOBJCXX.dylib
./Products/Applications/GroundControl Launchpad.app/Contents/Frameworks/libboost.dylib
./Products/Applications/GroundControl Launchpad.app/Contents/Frameworks/libminizip.dylib
./Products/Applications/GroundControl Launchpad.app/Contents/Frameworks/libcrypto.1.1.dylib
./Products/Applications/GroundControl Launchpad.app/Contents/Frameworks/libGCClientService.dylib
./Products/Applications/GroundControl Launchpad.app/Contents/Frameworks/libdispatch_noexcept.dylib
./Products/Applications/GroundControl Launchpad.app/Contents/Frameworks/libsqlite++.dylib
./Products/@rpath/libggcurl.dylib
./Products/@rpath/libGCPlatformCompatibility.dylib
./Products/@rpath/libusb-1.0.dylib
./Products/@rpath/libusb++.dylib
./Products/@rpath/libcbrx.dylib
./Products/@rpath/libssl_binaries.dylib
./Products/@rpath/libCF++.dylib
./Products/@rpath/libGCLog.dylib
./Products/@rpath/libboost.dylib