diff options
author | Jonathan Earnshaw <j.earnshaw@gmail.com> | 2023-11-28 01:51:45 (GMT) |
---|---|---|
committer | Jonathan Earnshaw <j.earnshaw@gmail.com> | 2023-11-29 21:09:34 (GMT) |
commit | 2b4bb43ed385cf57d38e21bc1f5971e59c73ce6c (patch) | |
tree | fb8121b542f31292ca323c97b850ba489c9ba877 /Tests/RunCMake/XcodeProject-Embed | |
parent | 245e111269c4cdb903629e84e9ee148f6e0573f6 (diff) | |
download | CMake-2b4bb43ed385cf57d38e21bc1f5971e59c73ce6c.zip CMake-2b4bb43ed385cf57d38e21bc1f5971e59c73ce6c.tar.gz CMake-2b4bb43ed385cf57d38e21bc1f5971e59c73ce6c.tar.bz2 |
Xcode: Add support to embed XPC Services
Diffstat (limited to 'Tests/RunCMake/XcodeProject-Embed')
5 files changed, 46 insertions, 0 deletions
diff --git a/Tests/RunCMake/XcodeProject-Embed/EmbedXPCServices-macOS-check.cmake b/Tests/RunCMake/XcodeProject-Embed/EmbedXPCServices-macOS-check.cmake new file mode 100644 index 0000000..706add5 --- /dev/null +++ b/Tests/RunCMake/XcodeProject-Embed/EmbedXPCServices-macOS-check.cmake @@ -0,0 +1,3 @@ +include(${CMAKE_CURRENT_LIST_DIR}/findAttribute.cmake) + +findAttribute(${test} "Embed XPC Services" TRUE) diff --git a/Tests/RunCMake/XcodeProject-Embed/EmbedXPCServices-macOS.cmake b/Tests/RunCMake/XcodeProject-Embed/EmbedXPCServices-macOS.cmake new file mode 100644 index 0000000..5ad0436 --- /dev/null +++ b/Tests/RunCMake/XcodeProject-Embed/EmbedXPCServices-macOS.cmake @@ -0,0 +1 @@ +include(${CMAKE_CURRENT_LIST_DIR}/EmbedXPCServices.cmake) diff --git a/Tests/RunCMake/XcodeProject-Embed/EmbedXPCServices.cmake b/Tests/RunCMake/XcodeProject-Embed/EmbedXPCServices.cmake new file mode 100644 index 0000000..877a685 --- /dev/null +++ b/Tests/RunCMake/XcodeProject-Embed/EmbedXPCServices.cmake @@ -0,0 +1,17 @@ +add_executable(xpc_service MACOSX_BUNDLE main.m) +set_target_properties(xpc_service PROPERTIES + BUNDLE_EXTENSION "xpc" + XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO" + XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "" + MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/XPCService.Info.plist.in" + MACOSX_BUNDLE_GUI_IDENTIFIER "com.example.app.xpc_service" +) + +add_executable(app MACOSX_BUNDLE main.m) +add_dependencies(app xpc_service) +set_target_properties(app PROPERTIES + XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO" + XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "" + XCODE_EMBED_XPC_SERVICES xpc_service + MACOSX_BUNDLE_GUI_IDENTIFIER "com.example.app" +) diff --git a/Tests/RunCMake/XcodeProject-Embed/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject-Embed/RunCMakeTest.cmake index 3798ddc..77ac63f 100644 --- a/Tests/RunCMake/XcodeProject-Embed/RunCMakeTest.cmake +++ b/Tests/RunCMake/XcodeProject-Embed/RunCMakeTest.cmake @@ -122,4 +122,5 @@ if(XCODE_VERSION VERSION_GREATER_EQUAL 14.1) TestEmbedCommon(Resources macOS) TestEmbedCommon(Resources iOS) TestEmbedCommon(PlugIns macOS) + TestEmbedCommon(XPCServices macOS) endif() diff --git a/Tests/RunCMake/XcodeProject-Embed/XPCService.Info.plist.in b/Tests/RunCMake/XcodeProject-Embed/XPCService.Info.plist.in new file mode 100644 index 0000000..abc8db2 --- /dev/null +++ b/Tests/RunCMake/XcodeProject-Embed/XPCService.Info.plist.in @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CFBundleDevelopmentRegion</key> + <string>$(DEVELOPMENT_LANGUAGE)</string> + <key>CFBundleDisplayName</key> + <string>SomeExtension</string> + <key>CFBundleExecutable</key> + <string>$(EXECUTABLE_NAME)</string> + <key>CFBundleIdentifier</key> + <string>com.example.app.xpc_service</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundleName</key> + <string>example_app_xpc_service</string> + <key>CFBundlePackageType</key> + <string>XPC!</string> + <key>CFBundleShortVersionString</key> + <string>1.0.0</string> + <key>CFBundleVersion</key> + <string>1.0.0</string> +</dict> +</plist> |