We’re building a complex iOS app that includes:
- a main app
- an App Clip
- a watchOS app
- a widget extension
- a notification service extension
We’re using CMake to generate our Xcode project, and we’ve noticed:
XCODE_EMBED_PLUGINS
works fine for embedding the Watch AppXCODE_EMBED_EXTENSIONKIT_EXTENSIONS
works for embedding the App Clip- The widget and notification service embed correctly without issues
However, Xcode expects specific PBXCopyFilesBuildPhase
sections for embedding App Clips and Watch apps that are currently not generated by CMake:
xcodeproj
/* Embed Watch Content */ = {
isa = PBXCopyFilesBuildPhase;
dstPath = "$(CONTENTS_FOLDER_PATH)/Watch";
dstSubfolderSpec = 16;
...
name = "Embed Watch Content";
};
/* Embed App Clips */ = {
isa = PBXCopyFilesBuildPhase;
dstPath = "$(CONTENTS_FOLDER_PATH)/AppClips";
dstSubfolderSpec = 16;
...
name = "Embed App Clips";
};
Currently, we workaround this by:
- Using
XCODE_EMBED_PLUGINS
andXCODE_EMBED_EXTENSIONKIT_EXTENSIONS
- Then post-processing the
.pbxproj
file with a Python script to patch thedstPath
,dstSubfolderSpec
, andname
fields.
Example CMake:
cmake
CopierModifier
set_target_properties(${PROJECT_NAME} PROPERTIES
XCODE_EMBED_APP_EXTENSIONS "${ALL_APP_EXTENSIONS}"
XCODE_EMBED_APP_EXTENSION_CODE_SIGN_ON_COPY "YES"
)
set_target_properties(${PROJECT_NAME} PROPERTIES
XCODE_EMBED_PLUGINS "${WATCH_APP_NAME}"
)
set_target_properties(${PROJECT_NAME} PROPERTIES
XCODE_EMBED_EXTENSIONKIT_EXTENSIONS "${APPCLIP_NAME}"
)
Request:
Please consider adding official support for:
XCODE_EMBED_APPCLIP
XCODE_EMBED_WATCHAPP
That would generate the correct PBXCopyFilesBuildPhase
blocks directly, without requiring post-processing. It would bring the generated project in line with what Xcode produces when setting up these targets manually.
Thanks!