diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 18:07:22 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 18:07:22 +0000 |
commit | c04dcc2e7d834218ef2d4194331e383402495ae1 (patch) | |
tree | 7333e38d10d75386e60f336b80c2443c1166031d /cmake/scripts/darwin_embedded/ExtraTargets.cmake | |
parent | Initial commit. (diff) | |
download | kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.tar.xz kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.zip |
Adding upstream version 2:20.4+dfsg.upstream/2%20.4+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cmake/scripts/darwin_embedded/ExtraTargets.cmake')
-rw-r--r-- | cmake/scripts/darwin_embedded/ExtraTargets.cmake | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/cmake/scripts/darwin_embedded/ExtraTargets.cmake b/cmake/scripts/darwin_embedded/ExtraTargets.cmake new file mode 100644 index 0000000..01ab632 --- /dev/null +++ b/cmake/scripts/darwin_embedded/ExtraTargets.cmake @@ -0,0 +1,32 @@ +if(CORE_PLATFORM_NAME_LC STREQUAL tvos) + # top shelf extension + set(TOPSHELF_EXTENSION_NAME "${APP_NAME_LC}-topshelf") + set(TOPSHELF_BUNDLE_EXTENSION appex) + set(TOPSHELF_DIR "${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/tvos/TopShelf") + # same path as the output Info.plist, taken from cmGlobalXCodeGenerator::ComputeInfoPListLocation() + set(ENTITLEMENTS_OUT_PATH "${CMAKE_BINARY_DIR}/CMakeFiles/${TOPSHELF_EXTENSION_NAME}.dir/TopShelf.entitlements") + + set(SOURCES + ${TOPSHELF_DIR}/../../ios-common/DarwinEmbedUtils.mm + ${TOPSHELF_DIR}/ServiceProvider.mm + ${TOPSHELF_DIR}/../tvosShared.mm) + set(HEADERS + ${TOPSHELF_DIR}/../../ios-common/DarwinEmbedUtils.h + ${TOPSHELF_DIR}/ServiceProvider.h + ${TOPSHELF_DIR}/../tvosShared.h) + add_executable(${TOPSHELF_EXTENSION_NAME} MACOSX_BUNDLE ${SOURCES} ${HEADERS}) + + configure_file(${TOPSHELF_DIR}/TopShelf.entitlements.in ${ENTITLEMENTS_OUT_PATH} @ONLY) + set_target_properties(${TOPSHELF_EXTENSION_NAME} PROPERTIES BUNDLE_EXTENSION ${TOPSHELF_BUNDLE_EXTENSION} + MACOSX_BUNDLE_INFO_PLIST ${TOPSHELF_DIR}/Info.plist.in + XCODE_PRODUCT_TYPE com.apple.product-type.tv-app-extension + XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${ENTITLEMENTS_OUT_PATH}) + target_link_libraries(${TOPSHELF_EXTENSION_NAME} "-framework TVServices" "-framework Foundation") + + add_custom_command(TARGET ${TOPSHELF_EXTENSION_NAME} POST_BUILD + COMMAND "NATIVEPREFIX=${NATIVEPREFIX}" + ${CMAKE_SOURCE_DIR}/tools/darwin/Support/Codesign-topshelf.command + ) + + add_dependencies(${APP_NAME_LC} ${TOPSHELF_EXTENSION_NAME}) +endif() |