[video] Fix bookmark thumbnails of rotated videos
[xbmc.git] / cmake / scripts / darwin_embedded / Install.cmake
blobc408e173ca46ffd3db6cf733a815e263474ca358
1 # IOS/TVOS packaging
2 if(CORE_PLATFORM_NAME_LC STREQUAL tvos)
3   # asset catalog
4   set(ASSET_CATALOG "${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/tvos/Assets.xcassets")
5   set(ASSET_CATALOG_ASSETS Assets)
6   set(ASSET_CATALOG_LAUNCH_IMAGE LaunchImage)
8   message("generating missing asset catalog images...")
9   execute_process(COMMAND ${CMAKE_SOURCE_DIR}/tools/darwin/Support/GenerateMissingImages-tvos.py "${ASSET_CATALOG}" ${ASSET_CATALOG_ASSETS} ${ASSET_CATALOG_LAUNCH_IMAGE})
11   target_sources(${APP_NAME_LC} PRIVATE "${ASSET_CATALOG}")
12   set_source_files_properties("${ASSET_CATALOG}" PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") # adds to Copy Bundle Resources build phase
14   # entitlements
15   set(ENTITLEMENTS_OUT_PATH "${CMAKE_BINARY_DIR}/CMakeFiles/${APP_NAME_LC}.dir/Kodi.entitlements")
16   configure_file(${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/tvos/Kodi.entitlements.in ${ENTITLEMENTS_OUT_PATH} @ONLY)
18   set_target_properties(${APP_NAME_LC} PROPERTIES XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME ${ASSET_CATALOG_ASSETS}
19                                                   XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME ${ASSET_CATALOG_LAUNCH_IMAGE}
20                                                   XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS ${ENTITLEMENTS_OUT_PATH})
22 else()
23   set(BUNDLE_RESOURCES ${CMAKE_SOURCE_DIR}/media/applaunch_screen.png
24                        ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon29x29.png
25                        ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon29x29@2x.png
26                        ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon40x40.png
27                        ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon40x40@2x.png
28                        ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon50x50.png
29                        ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon50x50@2x.png
30                        ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon57x57.png
31                        ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon57x57@2x.png
32                        ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon60x60.png
33                        ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon60x60@2x.png
34                        ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon72x72.png
35                        ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon72x72@2x.png
36                        ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon76x76.png
37                        ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon76x76@2x.png)
39   target_sources(${APP_NAME_LC} PRIVATE ${BUNDLE_RESOURCES})
40   foreach(file IN LISTS BUNDLE_RESOURCES)
41     set_source_files_properties(${file} PROPERTIES MACOSX_PACKAGE_LOCATION .)
42   endforeach()
44   target_sources(${APP_NAME_LC} PRIVATE ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchScreen.storyboard)
45   set_source_files_properties(${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/LaunchScreen.storyboard PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
47 endif()
49 # setup code signing
50 # dev team ID / identity (certificate)
51 set(DEVELOPMENT_TEAM "" CACHE STRING "Development Team")
52 set(CODE_SIGN_IDENTITY $<IF:$<BOOL:${DEVELOPMENT_TEAM}>,iPhone\ Developer,> CACHE STRING "Code Sign Identity")
54 # app provisioning profile
55 set(CODE_SIGN_STYLE_APP Automatic)
56 set(PROVISIONING_PROFILE_APP "" CACHE STRING "Provisioning profile name for the Kodi app")
57 if(PROVISIONING_PROFILE_APP)
58   set(CODE_SIGN_STYLE_APP Manual)
59 endif()
61 # top shelf provisioning profile
62 if(CORE_PLATFORM_NAME_LC STREQUAL tvos)
63   set(CODE_SIGN_STYLE_TOPSHELF Automatic)
64   set(PROVISIONING_PROFILE_TOPSHELF "" CACHE STRING "Provisioning profile name for the Top Shelf")
65   if(PROVISIONING_PROFILE_TOPSHELF)
66     set(CODE_SIGN_STYLE_TOPSHELF Manual)
67   endif()
68   set_target_properties(${TOPSHELF_EXTENSION_NAME} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "${CODE_SIGN_IDENTITY}"
69                                                               XCODE_ATTRIBUTE_CODE_SIGN_STYLE ${CODE_SIGN_STYLE_TOPSHELF}
70                                                               XCODE_ATTRIBUTE_DEVELOPMENT_TEAM "${DEVELOPMENT_TEAM}"
71                                                               XCODE_ATTRIBUTE_PROVISIONING_PROFILE_SPECIFIER "${PROVISIONING_PROFILE_TOPSHELF}")
72   # copy extension inside PlugIns dir of the app bundle
73   add_custom_command(TARGET ${APP_NAME_LC} POST_BUILD
74       COMMAND ${CMAKE_COMMAND} ARGS -E copy_directory $<TARGET_BUNDLE_DIR:${TOPSHELF_EXTENSION_NAME}>
75                                                       $<TARGET_BUNDLE_DIR:${APP_NAME_LC}>/PlugIns/${TOPSHELF_EXTENSION_NAME}.${TOPSHELF_BUNDLE_EXTENSION}
76                                                       MAIN_DEPENDENCY ${TOPSHELF_EXTENSION_NAME})
77 endif()
78 set_target_properties(${APP_NAME_LC} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "${CODE_SIGN_IDENTITY}"
79                                                 XCODE_ATTRIBUTE_CODE_SIGN_STYLE ${CODE_SIGN_STYLE_APP}
80                                                 XCODE_ATTRIBUTE_DEVELOPMENT_TEAM "${DEVELOPMENT_TEAM}"
81                                                 XCODE_ATTRIBUTE_PROVISIONING_PROFILE_SPECIFIER "${PROVISIONING_PROFILE_APP}")
83 # Create xcode target that allows to build binary-addons.
84 if(ADDONS_TO_BUILD)
85   set(_addons "ADDONS=${ADDONS_TO_BUILD}")
86 endif()
87 add_custom_target(binary-addons
88   COMMAND make -C ${CMAKE_SOURCE_DIR}/tools/depends/target/binary-addons clean
89   COMMAND make -C ${CMAKE_SOURCE_DIR}/tools/depends/target/binary-addons VERBOSE=1 V=99
90         INSTALL_PREFIX="${CMAKE_BINARY_DIR}/addons" CROSS_COMPILING=yes ${_addons})
91 if(ENABLE_XCODE_ADDONBUILD)
92   add_dependencies(${APP_NAME_LC} binary-addons)
93 endif()
94 unset(_addons)
96 add_custom_command(TARGET ${APP_NAME_LC} POST_BUILD
97     # TODO: Remove in sync with CopyRootFiles-darwin_embedded expecting the ".bin" file
98     COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${APP_NAME_LC}>
99                                      $<TARGET_FILE_DIR:${APP_NAME_LC}>/${APP_NAME}.bin
101     COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/DllPaths_generated.h
102                                      ${CMAKE_BINARY_DIR}/xbmc/DllPaths_generated.h
103     COMMAND "ACTION=build"
104             "APP_NAME=${APP_NAME}"
105             "XBMC_DEPENDS=${DEPENDS_PATH}"
106             "SRCROOT=${CMAKE_BINARY_DIR}"
107             ${CMAKE_SOURCE_DIR}/tools/darwin/Support/CopyRootFiles-darwin_embedded.command
108     COMMAND "XBMC_DEPENDS=${DEPENDS_PATH}"
109             "PYTHON_VERSION=${PYTHON_VERSION}"
110             ${CMAKE_SOURCE_DIR}/tools/darwin/Support/copyframeworks-darwin_embedded.command
111     COMMAND ${CMAKE_SOURCE_DIR}/tools/darwin/Support/copyframeworks-dylibs2frameworks.command
112     COMMAND "XBMC_DEPENDS=${DEPENDS_PATH}"
113             "NATIVEPREFIX=${NATIVEPREFIX}"
114             ${CMAKE_SOURCE_DIR}/tools/darwin/Support/Codesign.command
117 if(CORE_PLATFORM_NAME_LC STREQUAL tvos)
118   add_custom_command(TARGET ${APP_NAME_LC} POST_BUILD
119     COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPENDS_PATH}/share/${APP_NAME_LC} $<TARGET_FILE_DIR:${APP_NAME_LC}>/AppData/AppHome
120   )
121 endif()
123 set(DEPENDS_ROOT_FOR_XCODE ${NATIVEPREFIX}/..)
124 configure_file(${CMAKE_SOURCE_DIR}/tools/darwin/packaging/darwin_embedded/mkdeb-darwin_embedded.sh.in
125                ${CMAKE_BINARY_DIR}/tools/darwin/packaging/darwin_embedded/mkdeb-darwin_embedded.sh @ONLY)
127 configure_file(${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/Credits.html.in
128                ${CMAKE_BINARY_DIR}/xbmc/platform/darwin/Credits.html @ONLY)
130 add_custom_target(deb
131     COMMAND sh ./mkdeb-darwin_embedded.sh ${CORE_BUILD_CONFIG}
132     WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tools/darwin/packaging/darwin_embedded)
133 add_dependencies(deb ${APP_NAME_LC})