diff options
| author | manuel <manuel@mausz.at> | 2016-12-14 02:24:46 +0100 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2016-12-14 02:24:46 +0100 |
| commit | a662ba767a6444b76b0394eb60380eee3e839db7 (patch) | |
| tree | a13d904b75e8d899e2b11df3db5bd2a8a47b0acb /project/cmake/scripts | |
| parent | 2818eb9609d118212211cd657134974f10428b31 (diff) | |
| download | kodi-pvr-build-a662ba767a6444b76b0394eb60380eee3e839db7.tar.gz kodi-pvr-build-a662ba767a6444b76b0394eb60380eee3e839db7.tar.bz2 kodi-pvr-build-a662ba767a6444b76b0394eb60380eee3e839db7.zip | |
Sync with Krypton branch
Diffstat (limited to 'project/cmake/scripts')
| -rw-r--r-- | project/cmake/scripts/common/HandleDepends.cmake | 43 | ||||
| -rw-r--r-- | project/cmake/scripts/common/Macros.cmake | 9 | ||||
| -rw-r--r-- | project/cmake/scripts/common/PrepareEnv.cmake | 47 | ||||
| -rw-r--r-- | project/cmake/scripts/ios/ArchSetup.cmake | 21 | ||||
| -rw-r--r-- | project/cmake/scripts/ios/Install.cmake | 93 | ||||
| -rw-r--r-- | project/cmake/scripts/linux/ArchSetup.cmake | 4 | ||||
| -rw-r--r-- | project/cmake/scripts/linux/Install.cmake | 12 | ||||
| -rw-r--r-- | project/cmake/scripts/linux/PathSetup.cmake | 1 | ||||
| -rw-r--r-- | project/cmake/scripts/osx/Macros.cmake | 9 | ||||
| -rw-r--r-- | project/cmake/scripts/windows/tools/patch.cmake | 37 |
10 files changed, 90 insertions, 186 deletions
diff --git a/project/cmake/scripts/common/HandleDepends.cmake b/project/cmake/scripts/common/HandleDepends.cmake index adc105b..880ccdf 100644 --- a/project/cmake/scripts/common/HandleDepends.cmake +++ b/project/cmake/scripts/common/HandleDepends.cmake | |||
| @@ -17,7 +17,6 @@ function(add_addon_depends addon searchpath) | |||
| 17 | file MATCHES noinstall.txt OR | 17 | file MATCHES noinstall.txt OR |
| 18 | file MATCHES flags.txt OR | 18 | file MATCHES flags.txt OR |
| 19 | file MATCHES deps.txt OR | 19 | file MATCHES deps.txt OR |
| 20 | file MATCHES "[a-z]+-deps[.]txt" OR | ||
| 21 | file MATCHES platforms.txt)) | 20 | file MATCHES platforms.txt)) |
| 22 | message(STATUS "Processing ${file}") | 21 | message(STATUS "Processing ${file}") |
| 23 | file(STRINGS ${file} def) | 22 | file(STRINGS ${file} def) |
| @@ -50,11 +49,7 @@ function(add_addon_depends addon searchpath) | |||
| 50 | if(EXISTS ${dir}/flags.txt) | 49 | if(EXISTS ${dir}/flags.txt) |
| 51 | set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/flags.txt) | 50 | set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/flags.txt) |
| 52 | file(STRINGS ${dir}/flags.txt extraflags) | 51 | file(STRINGS ${dir}/flags.txt extraflags) |
| 53 | |||
| 54 | # replace some custom placeholders | ||
| 55 | string(REPLACE "@MINGW_TOOLCHAIN_FILE@" "${OUTPUT_DIR}/Toolchain_mingw32.cmake" extraflags "${extraflags}") | ||
| 56 | string(REPLACE " " ";" extraflags ${extraflags}) | 52 | string(REPLACE " " ";" extraflags ${extraflags}) |
| 57 | |||
| 58 | message(STATUS "${id} extraflags: ${extraflags}") | 53 | message(STATUS "${id} extraflags: ${extraflags}") |
| 59 | endif() | 54 | endif() |
| 60 | 55 | ||
| @@ -108,18 +103,11 @@ function(add_addon_depends addon searchpath) | |||
| 108 | endif() | 103 | endif() |
| 109 | endif() | 104 | endif() |
| 110 | 105 | ||
| 106 | # on windows "patch.exe" can only handle CR-LF line-endings so we | ||
| 107 | # need to force it to also handle LF-only line endings | ||
| 111 | set(PATCH_PROGRAM ${PATCH_EXECUTABLE}) | 108 | set(PATCH_PROGRAM ${PATCH_EXECUTABLE}) |
| 112 | |||
| 113 | # On Windows "patch.exe" can only handle CR-LF line-endings. | ||
| 114 | # Our patches have LF-only line endings - except when they | ||
| 115 | # have been checked out as part of a dependency hosted on Git | ||
| 116 | # and core.autocrlf=true. | ||
| 117 | if(WIN32) | 109 | if(WIN32) |
| 118 | file(READ ${patch} patch_content_hex HEX) | 110 | set(PATCH_PROGRAM "\"${PATCH_PROGRAM}\" --binary") |
| 119 | # Force handle LF-only line endings | ||
| 120 | if(NOT patch_content_hex MATCHES "0d0a") | ||
| 121 | set(PATCH_PROGRAM "\"${PATCH_PROGRAM}\" --binary") | ||
| 122 | endif() | ||
| 123 | endif() | 111 | endif() |
| 124 | endif() | 112 | endif() |
| 125 | 113 | ||
| @@ -143,11 +131,8 @@ function(add_addon_depends addon searchpath) | |||
| 143 | set(INSTALL_COMMAND INSTALL_COMMAND "") | 131 | set(INSTALL_COMMAND INSTALL_COMMAND "") |
| 144 | endif() | 132 | endif() |
| 145 | 133 | ||
| 146 | # check if there's a platform-specific or generic deps.txt containing dependencies on other libraries | 134 | # check if there's a deps.txt containing dependencies on other libraries |
| 147 | if(EXISTS ${dir}/${CORE_SYSTEM_NAME}-deps.txt) | 135 | if(EXISTS ${dir}/deps.txt) |
| 148 | file(STRINGS ${dir}/${CORE_SYSTEM_NAME}-deps.txt deps) | ||
| 149 | message(STATUS "${id} depends: ${deps}") | ||
| 150 | elseif(EXISTS ${dir}/deps.txt) | ||
| 151 | set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/deps.txt) | 136 | set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/deps.txt) |
| 152 | file(STRINGS ${dir}/deps.txt deps) | 137 | file(STRINGS ${dir}/deps.txt deps) |
| 153 | message(STATUS "${id} depends: ${deps}") | 138 | message(STATUS "${id} depends: ${deps}") |
| @@ -176,10 +161,6 @@ function(add_addon_depends addon searchpath) | |||
| 176 | PATCH_COMMAND ${PATCH_COMMAND} | 161 | PATCH_COMMAND ${PATCH_COMMAND} |
| 177 | "${INSTALL_COMMAND}") | 162 | "${INSTALL_COMMAND}") |
| 178 | 163 | ||
| 179 | if(CMAKE_VERSION VERSION_GREATER 3.5.9) | ||
| 180 | list(APPEND EXTERNALPROJECT_SETUP GIT_SHALLOW 1) | ||
| 181 | endif() | ||
| 182 | |||
| 183 | # if there's an url defined we need to pass that to externalproject_add() | 164 | # if there's an url defined we need to pass that to externalproject_add() |
| 184 | if(DEFINED url AND NOT "${url}" STREQUAL "") | 165 | if(DEFINED url AND NOT "${url}" STREQUAL "") |
| 185 | # check if there's a third parameter in the file | 166 | # check if there's a third parameter in the file |
| @@ -191,20 +172,6 @@ function(add_addon_depends addon searchpath) | |||
| 191 | GIT_REPOSITORY ${url} | 172 | GIT_REPOSITORY ${url} |
| 192 | GIT_TAG ${revision} | 173 | GIT_TAG ${revision} |
| 193 | "${EXTERNALPROJECT_SETUP}") | 174 | "${EXTERNALPROJECT_SETUP}") |
| 194 | |||
| 195 | # For patchfiles to work, disable (users globally set) autocrlf=true | ||
| 196 | if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_GREATER 3.7) | ||
| 197 | message(AUTHOR_WARNING "Make use of GIT_CONFIG") | ||
| 198 | endif() | ||
| 199 | if(WIN32 AND patches) | ||
| 200 | externalproject_add_step(${id} gitconfig | ||
| 201 | COMMAND git config core.autocrlf false | ||
| 202 | COMMAND git rm -rf --cached . | ||
| 203 | COMMAND git reset --hard HEAD | ||
| 204 | COMMENT "Performing gitconfig step: Disabling autocrlf to enable patching for '${id}'" | ||
| 205 | DEPENDERS patch | ||
| 206 | WORKING_DIRECTORY <SOURCE_DIR>) | ||
| 207 | endif() | ||
| 208 | else() | 175 | else() |
| 209 | set(CONFIGURE_COMMAND "") | 176 | set(CONFIGURE_COMMAND "") |
| 210 | if(NOT WIN32) | 177 | if(NOT WIN32) |
diff --git a/project/cmake/scripts/common/Macros.cmake b/project/cmake/scripts/common/Macros.cmake index cce3245..71c39ef 100644 --- a/project/cmake/scripts/common/Macros.cmake +++ b/project/cmake/scripts/common/Macros.cmake | |||
| @@ -155,12 +155,9 @@ function(core_add_shared_library name) | |||
| 155 | add_library(${name} SHARED ${SOURCES} ${HEADERS} ${OTHERS}) | 155 | add_library(${name} SHARED ${SOURCES} ${HEADERS} ${OTHERS}) |
| 156 | set_target_properties(${name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${OUTPUT_DIRECTORY} | 156 | set_target_properties(${name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${OUTPUT_DIRECTORY} |
| 157 | RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${OUTPUT_DIRECTORY} | 157 | RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${OUTPUT_DIRECTORY} |
| 158 | RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/${OUTPUT_DIRECTORY} | ||
| 159 | RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/${OUTPUT_DIRECTORY} | ||
| 158 | OUTPUT_NAME ${OUTPUT_NAME} PREFIX "") | 160 | OUTPUT_NAME ${OUTPUT_NAME} PREFIX "") |
| 159 | foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES}) | ||
| 160 | string(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG) | ||
| 161 | set_target_properties(${name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/${OUTPUT_DIRECTORY} | ||
| 162 | RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_BINARY_DIR}/${OUTPUT_DIRECTORY}) | ||
| 163 | endforeach() | ||
| 164 | 161 | ||
| 165 | set(LIBRARY_FILES ${LIBRARY_FILES} ${CMAKE_BINARY_DIR}/${OUTPUT_DIRECTORY}/${OUTPUT_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} CACHE STRING "" FORCE) | 162 | set(LIBRARY_FILES ${LIBRARY_FILES} ${CMAKE_BINARY_DIR}/${OUTPUT_DIRECTORY}/${OUTPUT_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} CACHE STRING "" FORCE) |
| 166 | add_dependencies(${APP_NAME_LC}-libraries ${name}) | 163 | add_dependencies(${APP_NAME_LC}-libraries ${name}) |
| @@ -598,9 +595,9 @@ macro(core_find_versions) | |||
| 598 | set(APP_VERSION ${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}) | 595 | set(APP_VERSION ${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}) |
| 599 | if(APP_VERSION_TAG) | 596 | if(APP_VERSION_TAG) |
| 600 | set(APP_VERSION ${APP_VERSION}-${APP_VERSION_TAG}) | 597 | set(APP_VERSION ${APP_VERSION}-${APP_VERSION_TAG}) |
| 601 | string(TOLOWER ${APP_VERSION_TAG} APP_VERSION_TAG_LC) | ||
| 602 | endif() | 598 | endif() |
| 603 | string(REPLACE "." "," FILE_VERSION ${APP_ADDON_API}.0) | 599 | string(REPLACE "." "," FILE_VERSION ${APP_ADDON_API}.0) |
| 600 | string(TOLOWER ${APP_VERSION_TAG} APP_VERSION_TAG_LC) | ||
| 604 | file(STRINGS ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h guilib_version REGEX "^.*GUILIB_API_VERSION (.*)$") | 601 | file(STRINGS ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h guilib_version REGEX "^.*GUILIB_API_VERSION (.*)$") |
| 605 | string(REGEX REPLACE ".*\"(.*)\"" "\\1" guilib_version ${guilib_version}) | 602 | string(REGEX REPLACE ".*\"(.*)\"" "\\1" guilib_version ${guilib_version}) |
| 606 | file(STRINGS ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h guilib_version_min REGEX "^.*GUILIB_MIN_API_VERSION (.*)$") | 603 | file(STRINGS ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h guilib_version_min REGEX "^.*GUILIB_MIN_API_VERSION (.*)$") |
diff --git a/project/cmake/scripts/common/PrepareEnv.cmake b/project/cmake/scripts/common/PrepareEnv.cmake index 51be739..8e02382 100644 --- a/project/cmake/scripts/common/PrepareEnv.cmake +++ b/project/cmake/scripts/common/PrepareEnv.cmake | |||
| @@ -51,14 +51,43 @@ foreach(binding ${bindings}) | |||
| 51 | configure_file(${CORE_SOURCE_DIR}/${header} ${APP_INCLUDE_DIR} COPYONLY) | 51 | configure_file(${CORE_SOURCE_DIR}/${header} ${APP_INCLUDE_DIR} COPYONLY) |
| 52 | endforeach() | 52 | endforeach() |
| 53 | 53 | ||
| 54 | ### processing additional tools required by the platform | 54 | ### on windows we need a "patch" binary to be able to patch 3rd party sources |
| 55 | if(EXISTS ${CORE_SOURCE_DIR}/project/cmake/scripts/${CORE_SYSTEM_NAME}/tools/) | 55 | if(WIN32) |
| 56 | file(GLOB platform_tools ${CORE_SOURCE_DIR}/project/cmake/scripts/${CORE_SYSTEM_NAME}/tools/*.cmake) | 56 | find_program(PATCH_FOUND NAMES patch patch.exe) |
| 57 | foreach(platform_tool ${platform_tools}) | 57 | if(PATCH_FOUND) |
| 58 | get_filename_component(platform_tool_name ${platform_tool} NAME_WE) | 58 | message(STATUS "patch utility found at ${PATCH_FOUND}") |
| 59 | message(STATUS "Processing ${CORE_SYSTEM_NAME} specific tool: ${platform_tool_name}") | 59 | else() |
| 60 | set(PATCH_ARCHIVE_NAME "patch-2.5.9-7-bin-3") | ||
| 61 | set(PATCH_ARCHIVE "${PATCH_ARCHIVE_NAME}.zip") | ||
| 62 | set(PATCH_URL "${KODI_MIRROR}/build-deps/win32/${PATCH_ARCHIVE}") | ||
| 63 | set(PATCH_DOWNLOAD ${BUILD_DIR}/download/${PATCH_ARCHIVE}) | ||
| 60 | 64 | ||
| 61 | # include the file | 65 | # download the archive containing patch.exe |
| 62 | include(${platform_tool}) | 66 | message(STATUS "Downloading patch utility from ${PATCH_URL}...") |
| 63 | endforeach() | 67 | file(DOWNLOAD "${PATCH_URL}" "${PATCH_DOWNLOAD}" STATUS PATCH_DL_STATUS LOG PATCH_LOG SHOW_PROGRESS) |
| 68 | list(GET PATCH_DL_STATUS 0 PATCH_RETCODE) | ||
| 69 | if(NOT ${PATCH_RETCODE} EQUAL 0) | ||
| 70 | message(FATAL_ERROR "ERROR downloading ${PATCH_URL} - status: ${PATCH_DL_STATUS} log: ${PATCH_LOG}") | ||
| 71 | endif() | ||
| 72 | |||
| 73 | # extract the archive containing patch.exe | ||
| 74 | execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzvf ${PATCH_DOWNLOAD} | ||
| 75 | WORKING_DIRECTORY ${BUILD_DIR}) | ||
| 76 | |||
| 77 | # make sure the extraction worked and that patch.exe is there | ||
| 78 | set(PATCH_PATH ${BUILD_DIR}/${PATCH_ARCHIVE_NAME}) | ||
| 79 | set(PATCH_BINARY_PATH ${PATCH_PATH}/bin/patch.exe) | ||
| 80 | if(NOT EXISTS ${PATCH_PATH} OR NOT EXISTS ${PATCH_BINARY_PATH}) | ||
| 81 | message(FATAL_ERROR "ERROR extracting patch utility from ${PATCH_DOWNLOAD_DIR}") | ||
| 82 | endif() | ||
| 83 | |||
| 84 | # copy patch.exe into the output directory | ||
| 85 | file(INSTALL ${PATCH_BINARY_PATH} DESTINATION ${ADDON_DEPENDS_PATH}/bin) | ||
| 86 | |||
| 87 | # make sure that cmake can find the copied patch.exe | ||
| 88 | find_program(PATCH_FOUND NAMES patch patch.exe) | ||
| 89 | if(NOT PATCH_FOUND) | ||
| 90 | message(FATAL_ERROR "ERROR installing patch utility from ${PATCH_BINARY_PATH} to ${ADDON_DEPENDS_PATH}/bin") | ||
| 91 | endif() | ||
| 92 | endif() | ||
| 64 | endif() | 93 | endif() |
diff --git a/project/cmake/scripts/ios/ArchSetup.cmake b/project/cmake/scripts/ios/ArchSetup.cmake index f3e8590..56661e2 100644 --- a/project/cmake/scripts/ios/ArchSetup.cmake +++ b/project/cmake/scripts/ios/ArchSetup.cmake | |||
| @@ -13,7 +13,6 @@ if(WITH_ARCH) | |||
| 13 | set(ARCH ${WITH_ARCH}) | 13 | set(ARCH ${WITH_ARCH}) |
| 14 | else() | 14 | else() |
| 15 | if(CPU STREQUAL armv7 OR CPU STREQUAL arm64) | 15 | if(CPU STREQUAL armv7 OR CPU STREQUAL arm64) |
| 16 | set(CMAKE_OSX_ARCHITECTURES ${CPU}) | ||
| 17 | set(ARCH arm-osx) | 16 | set(ARCH arm-osx) |
| 18 | set(NEON False) | 17 | set(NEON False) |
| 19 | else() | 18 | else() |
| @@ -35,23 +34,3 @@ list(APPEND DEPLIBS "-framework CoreFoundation" "-framework CoreVideo" | |||
| 35 | 34 | ||
| 36 | set(ENABLE_DVDCSS OFF CACHE BOOL "" FORCE) | 35 | set(ENABLE_DVDCSS OFF CACHE BOOL "" FORCE) |
| 37 | set(ENABLE_OPTICAL OFF CACHE BOOL "" FORCE) | 36 | set(ENABLE_OPTICAL OFF CACHE BOOL "" FORCE) |
| 38 | |||
| 39 | set(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "5.1") | ||
| 40 | set(CMAKE_XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2") | ||
| 41 | |||
| 42 | set(CMAKE_XCODE_ATTRIBUTE_INLINES_ARE_PRIVATE_EXTERN OFF) | ||
| 43 | set(CMAKE_XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN OFF) | ||
| 44 | set(CMAKE_XCODE_ATTRIBUTE_COPY_PHASE_STRIP OFF) | ||
| 45 | |||
| 46 | # Xcode strips dead code by default which breaks wrapping | ||
| 47 | set(CMAKE_XCODE_ATTRIBUTE_DEAD_CODE_STRIPPING OFF) | ||
| 48 | |||
| 49 | # Unify output directories for iOS packaging scripts | ||
| 50 | if(NOT CMAKE_GENERATOR MATCHES Xcode) | ||
| 51 | set(CORE_BUILD_CONFIG "${CORE_BUILD_CONFIG}-iphoneos") | ||
| 52 | endif() | ||
| 53 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CORE_BUILD_DIR}/${CORE_BUILD_CONFIG}) | ||
| 54 | foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES}) | ||
| 55 | string(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG) | ||
| 56 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CORE_BUILD_DIR}/${CORE_BUILD_CONFIG}) | ||
| 57 | endforeach() | ||
diff --git a/project/cmake/scripts/ios/Install.cmake b/project/cmake/scripts/ios/Install.cmake index c49fcd5..052565f 100644 --- a/project/cmake/scripts/ios/Install.cmake +++ b/project/cmake/scripts/ios/Install.cmake | |||
| @@ -1,54 +1,42 @@ | |||
| 1 | # IOS packaging | 1 | # IOS packaging |
| 2 | 2 | ||
| 3 | set(BUNDLE_RESOURCES ${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-568h@2x.png | 3 | set(PACKAGE_OUTPUT_DIR ${CMAKE_BINARY_DIR}/build/${CORE_BUILD_CONFIG}-iphoneos) |
| 4 | ${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-667h@2x.png | ||
| 5 | ${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-736h@3x.png | ||
| 6 | ${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-Landscape-736h@3x.png | ||
| 7 | ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon29x29.png | ||
| 8 | ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon29x29@2x.png | ||
| 9 | ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon40x40.png | ||
| 10 | ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon40x40@2x.png | ||
| 11 | ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon50x50.png | ||
| 12 | ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon50x50@2x.png | ||
| 13 | ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon57x57.png | ||
| 14 | ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon57x57@2x.png | ||
| 15 | ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon60x60.png | ||
| 16 | ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon60x60@2x.png | ||
| 17 | ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon72x72.png | ||
| 18 | ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon72x72@2x.png | ||
| 19 | ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon76x76.png | ||
| 20 | ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon76x76@2x.png) | ||
| 21 | 4 | ||
| 22 | if(CMAKE_GENERATOR STREQUAL Xcode) | 5 | file(MAKE_DIRECTORY ${PACKAGE_OUTPUT_DIR}/${APP_NAME}.app) |
| 23 | set(RESOURCE_LOCATION ${APP_NAME}.app) | 6 | set(BUNDLE_RESOURCES xbmc/platform/darwin/ios/Default-568h@2x.png |
| 24 | else() | 7 | xbmc/platform/darwin/ios/Default-667h@2x.png |
| 25 | set(RESOURCE_LOCATION ".") | 8 | xbmc/platform/darwin/ios/Default-736h@3x.png |
| 26 | endif() | 9 | xbmc/platform/darwin/ios/Default-Landscape-736h@3x.png |
| 10 | tools/darwin/packaging/media/ios/rounded/AppIcon29x29.png | ||
| 11 | tools/darwin/packaging/media/ios/rounded/AppIcon29x29@2x.png | ||
| 12 | tools/darwin/packaging/media/ios/rounded/AppIcon40x40.png | ||
| 13 | tools/darwin/packaging/media/ios/rounded/AppIcon40x40@2x.png | ||
| 14 | tools/darwin/packaging/media/ios/rounded/AppIcon50x50.png | ||
| 15 | tools/darwin/packaging/media/ios/rounded/AppIcon50x50@2x.png | ||
| 16 | tools/darwin/packaging/media/ios/rounded/AppIcon57x57.png | ||
| 17 | tools/darwin/packaging/media/ios/rounded/AppIcon57x57@2x.png | ||
| 18 | tools/darwin/packaging/media/ios/rounded/AppIcon60x60.png | ||
| 19 | tools/darwin/packaging/media/ios/rounded/AppIcon60x60@2x.png | ||
| 20 | tools/darwin/packaging/media/ios/rounded/AppIcon72x72.png | ||
| 21 | tools/darwin/packaging/media/ios/rounded/AppIcon72x72@2x.png | ||
| 22 | tools/darwin/packaging/media/ios/rounded/AppIcon76x76.png | ||
| 23 | tools/darwin/packaging/media/ios/rounded/AppIcon76x76@2x.png) | ||
| 27 | 24 | ||
| 28 | target_sources(${APP_NAME_LC} PRIVATE ${BUNDLE_RESOURCES}) | 25 | foreach(resource IN LISTS BUNDLE_RESOURCES) |
| 29 | foreach(file IN LISTS BUNDLE_RESOURCES) | 26 | configure_file(${CORE_SOURCE_DIR}/${resource} ${PACKAGE_OUTPUT_DIR}/${APP_NAME}.app COPYONLY) |
| 30 | set_source_files_properties(${file} PROPERTIES MACOSX_PACKAGE_LOCATION ${RESOURCE_LOCATION}) | ||
| 31 | endforeach() | 27 | endforeach() |
| 28 | configure_file(${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/English.lproj/InfoPlist.strings | ||
| 29 | ${PACKAGE_OUTPUT_DIR}/${APP_NAME}.app/English.lproj/InfoPlist.strings COPYONLY) | ||
| 32 | 30 | ||
| 33 | target_sources(${APP_NAME_LC} PRIVATE ${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/English.lproj/InfoPlist.strings) | 31 | configure_file(${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/Info.plist.in |
| 34 | set_source_files_properties(${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/English.lproj/InfoPlist.strings PROPERTIES MACOSX_PACKAGE_LOCATION "${RESOURCE_LOCATION}/English.lproj") | 32 | ${PACKAGE_OUTPUT_DIR}/${APP_NAME}.app/Info.plist @ONLY) |
| 35 | |||
| 36 | # Options for code signing propagated as env vars to Codesign.command via Xcode | ||
| 37 | set(IOS_CODE_SIGN_IDENTITY "" CACHE STRING "Code Sign Identity") | ||
| 38 | if(IOS_CODE_SIGN_IDENTITY) | ||
| 39 | set_target_properties(${APP_NAME_LC} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED TRUE | ||
| 40 | XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY ${IOS_CODE_SIGN_IDENTITY}) | ||
| 41 | endif() | ||
| 42 | |||
| 43 | add_custom_command(TARGET ${APP_NAME_LC} POST_BUILD | ||
| 44 | # TODO: Remove in sync with CopyRootFiles-ios expecting the ".bin" file | ||
| 45 | COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${APP_NAME_LC}> | ||
| 46 | $<TARGET_FILE_DIR:${APP_NAME_LC}>/${APP_NAME}.bin | ||
| 47 | 33 | ||
| 34 | add_custom_target(bundle | ||
| 35 | COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${APP_NAME_LC}> ${PACKAGE_OUTPUT_DIR}/${APP_NAME}.app/${APP_NAME}.bin | ||
| 48 | COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/DllPaths_generated.h | 36 | COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/DllPaths_generated.h |
| 49 | ${CMAKE_BINARY_DIR}/xbmc/DllPaths_generated.h | 37 | ${CMAKE_BINARY_DIR}/xbmc/DllPaths_generated.h |
| 50 | COMMAND "ACTION=build" | 38 | COMMAND "ACTION=build" |
| 51 | "TARGET_BUILD_DIR=$<TARGET_FILE_DIR:${APP_NAME_LC}>/.." | 39 | "TARGET_BUILD_DIR=${PACKAGE_OUTPUT_DIR}" |
| 52 | "TARGET_NAME=${APP_NAME}.app" | 40 | "TARGET_NAME=${APP_NAME}.app" |
| 53 | "APP_NAME=${APP_NAME}" | 41 | "APP_NAME=${APP_NAME}" |
| 54 | "PRODUCT_NAME=${APP_NAME}" | 42 | "PRODUCT_NAME=${APP_NAME}" |
| @@ -56,22 +44,15 @@ add_custom_command(TARGET ${APP_NAME_LC} POST_BUILD | |||
| 56 | "SRCROOT=${CMAKE_BINARY_DIR}" | 44 | "SRCROOT=${CMAKE_BINARY_DIR}" |
| 57 | ${CORE_SOURCE_DIR}/tools/darwin/Support/CopyRootFiles-ios.command | 45 | ${CORE_SOURCE_DIR}/tools/darwin/Support/CopyRootFiles-ios.command |
| 58 | COMMAND "XBMC_DEPENDS=${DEPENDS_PATH}" | 46 | COMMAND "XBMC_DEPENDS=${DEPENDS_PATH}" |
| 59 | "TARGET_BUILD_DIR=$<TARGET_FILE_DIR:${APP_NAME_LC}>/.." | 47 | "TARGET_BUILD_DIR=${PACKAGE_OUTPUT_DIR}" |
| 60 | "TARGET_NAME=${APP_NAME}.app" | 48 | "TARGET_NAME=${APP_NAME}.app" |
| 61 | "APP_NAME=${APP_NAME}" | 49 | "APP_NAME=${APP_NAME}" |
| 62 | "PRODUCT_NAME=${APP_NAME}" | 50 | "PRODUCT_NAME=${APP_NAME}" |
| 63 | "FULL_PRODUCT_NAME=${APP_NAME}.app" | 51 | "FULL_PRODUCT_NAME=${APP_NAME}.app" |
| 64 | "WRAPPER_EXTENSION=app" | 52 | "WRAPPER_EXTENSION=app" |
| 65 | "SRCROOT=${CMAKE_BINARY_DIR}" | 53 | "SRCROOT=${CMAKE_BINARY_DIR}" |
| 66 | ${CORE_SOURCE_DIR}/tools/darwin/Support/copyframeworks-ios.command | 54 | ${CORE_SOURCE_DIR}/tools/darwin/Support/copyframeworks-ios.command) |
| 67 | COMMAND "XBMC_DEPENDS_ROOT=${NATIVEPREFIX}/.." | 55 | add_dependencies(bundle ${APP_NAME_LC}) |
| 68 | "PLATFORM_NAME=${PLATFORM}" | ||
| 69 | "CODESIGNING_FOLDER_PATH=$<TARGET_FILE_DIR:${APP_NAME_LC}>" | ||
| 70 | "BUILT_PRODUCTS_DIR=$<TARGET_FILE_DIR:${APP_NAME_LC}>/.." | ||
| 71 | "WRAPPER_NAME=${APP_NAME}.app" | ||
| 72 | "APP_NAME=${APP_NAME}" | ||
| 73 | ${CORE_SOURCE_DIR}/tools/darwin/Support/Codesign.command | ||
| 74 | ) | ||
| 75 | 56 | ||
| 76 | set(DEPENDS_ROOT_FOR_XCODE ${NATIVEPREFIX}/..) | 57 | set(DEPENDS_ROOT_FOR_XCODE ${NATIVEPREFIX}/..) |
| 77 | configure_file(${CORE_SOURCE_DIR}/tools/darwin/packaging/ios/mkdeb-ios.sh.in | 58 | configure_file(${CORE_SOURCE_DIR}/tools/darwin/packaging/ios/mkdeb-ios.sh.in |
| @@ -80,6 +61,14 @@ configure_file(${CORE_SOURCE_DIR}/tools/darwin/packaging/migrate_to_kodi_ios.sh. | |||
| 80 | ${CMAKE_BINARY_DIR}/tools/darwin/packaging/migrate_to_kodi_ios.sh @ONLY) | 61 | ${CMAKE_BINARY_DIR}/tools/darwin/packaging/migrate_to_kodi_ios.sh @ONLY) |
| 81 | 62 | ||
| 82 | add_custom_target(deb | 63 | add_custom_target(deb |
| 64 | COMMAND "XBMC_DEPENDS_ROOT=${NATIVEPREFIX}/.." | ||
| 65 | "PLATFORM_NAME=${PLATFORM}" | ||
| 66 | "CODESIGNING_FOLDER_PATH=${PACKAGE_OUTPUT_DIR}/${APP_NAME}.app" | ||
| 67 | "BUILT_PRODUCTS_DIR=${PACKAGE_OUTPUT_DIR}" | ||
| 68 | "WRAPPER_NAME=${APP_NAME}.app" | ||
| 69 | "APP_NAME=${APP_NAME}" | ||
| 70 | "CODE_SIGN_IDENTITY=\"\"" | ||
| 71 | ${CORE_SOURCE_DIR}/tools/darwin/Support/Codesign.command | ||
| 83 | COMMAND sh ./mkdeb-ios.sh ${CORE_BUILD_CONFIG} | 72 | COMMAND sh ./mkdeb-ios.sh ${CORE_BUILD_CONFIG} |
| 84 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tools/darwin/packaging/ios) | 73 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tools/darwin/packaging/ios) |
| 85 | add_dependencies(deb ${APP_NAME_LC}) | 74 | add_dependencies(deb bundle) |
diff --git a/project/cmake/scripts/linux/ArchSetup.cmake b/project/cmake/scripts/linux/ArchSetup.cmake index bcd70df..cae0bb8 100644 --- a/project/cmake/scripts/linux/ArchSetup.cmake +++ b/project/cmake/scripts/linux/ArchSetup.cmake | |||
| @@ -39,7 +39,3 @@ if(CMAKE_BUILD_TYPE STREQUAL Coverage) | |||
| 39 | set(COVERAGE_DEPENDS "\${APP_NAME_LC}" "\${APP_NAME_LC}-test") | 39 | set(COVERAGE_DEPENDS "\${APP_NAME_LC}" "\${APP_NAME_LC}-test") |
| 40 | set(COVERAGE_EXCLUDES */test/* lib/* */lib/*) | 40 | set(COVERAGE_EXCLUDES */test/* lib/* */lib/*) |
| 41 | endif() | 41 | endif() |
| 42 | |||
| 43 | if(ENABLE_MIR) | ||
| 44 | set(ENABLE_VDPAU OFF CACHE BOOL "Disabling VDPAU since no Mir support" FORCE) | ||
| 45 | endif() | ||
diff --git a/project/cmake/scripts/linux/Install.cmake b/project/cmake/scripts/linux/Install.cmake index 43e2e5e..adf428d 100644 --- a/project/cmake/scripts/linux/Install.cmake +++ b/project/cmake/scripts/linux/Install.cmake | |||
| @@ -129,7 +129,7 @@ install(FILES ${CORE_SOURCE_DIR}/copying.txt | |||
| 129 | ${CORE_SOURCE_DIR}/LICENSE.GPL | 129 | ${CORE_SOURCE_DIR}/LICENSE.GPL |
| 130 | ${CORE_SOURCE_DIR}/version.txt | 130 | ${CORE_SOURCE_DIR}/version.txt |
| 131 | ${CORE_SOURCE_DIR}/docs/README.linux | 131 | ${CORE_SOURCE_DIR}/docs/README.linux |
| 132 | DESTINATION ${datarootdir}/doc/${APP_NAME_LC} | 132 | DESTINATION ${docdir} |
| 133 | COMPONENT kodi) | 133 | COMPONENT kodi) |
| 134 | 134 | ||
| 135 | install(FILES ${CORE_SOURCE_DIR}/privacy-policy.txt | 135 | install(FILES ${CORE_SOURCE_DIR}/privacy-policy.txt |
| @@ -154,14 +154,12 @@ install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kod | |||
| 154 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h | 154 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h |
| 155 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_codec.h | 155 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_codec.h |
| 156 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h | 156 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h |
| 157 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_game.h | ||
| 158 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_cpp_dll.h | 157 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_cpp_dll.h |
| 159 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_dll.h | 158 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_dll.h |
| 160 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_types.h | 159 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_types.h |
| 161 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_codec_types.h | 160 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_codec_types.h |
| 162 | ${CORE_SOURCE_DIR}/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h | 161 | ${CORE_SOURCE_DIR}/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h |
| 163 | ${CORE_SOURCE_DIR}/xbmc/filesystem/IFileTypes.h | 162 | ${CORE_SOURCE_DIR}/xbmc/filesystem/IFileTypes.h |
| 164 | ${CORE_SOURCE_DIR}/xbmc/input/XBMC_vkeys.h | ||
| 165 | DESTINATION ${includedir}/${APP_NAME_LC} | 163 | DESTINATION ${includedir}/${APP_NAME_LC} |
| 166 | COMPONENT kodi-addon-dev) | 164 | COMPONENT kodi-addon-dev) |
| 167 | 165 | ||
| @@ -314,14 +312,6 @@ install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kod | |||
| 314 | DESTINATION ${includedir}/${APP_NAME_LC} | 312 | DESTINATION ${includedir}/${APP_NAME_LC} |
| 315 | COMPONENT kodi-peripheral-dev) | 313 | COMPONENT kodi-peripheral-dev) |
| 316 | 314 | ||
| 317 | # Install kodi-game-dev | ||
| 318 | install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_callbacks.h | ||
| 319 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_dll.h | ||
| 320 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_types.h | ||
| 321 | DESTINATION ${includedir}/${APP_NAME_LC} | ||
| 322 | COMPONENT kodi-game-dev) | ||
| 323 | |||
| 324 | |||
| 325 | # Install XBT skin files | 315 | # Install XBT skin files |
| 326 | foreach(texture ${XBT_FILES}) | 316 | foreach(texture ${XBT_FILES}) |
| 327 | string(REPLACE "${CMAKE_BINARY_DIR}/" "" dir ${texture}) | 317 | string(REPLACE "${CMAKE_BINARY_DIR}/" "" dir ${texture}) |
diff --git a/project/cmake/scripts/linux/PathSetup.cmake b/project/cmake/scripts/linux/PathSetup.cmake index f69711e..5532c2d 100644 --- a/project/cmake/scripts/linux/PathSetup.cmake +++ b/project/cmake/scripts/linux/PathSetup.cmake | |||
| @@ -34,6 +34,7 @@ list(APPEND final_message "Bindir: ${bindir}") | |||
| 34 | list(APPEND final_message "Includedir: ${includedir}") | 34 | list(APPEND final_message "Includedir: ${includedir}") |
| 35 | list(APPEND final_message "Datarootdir: ${datarootdir}") | 35 | list(APPEND final_message "Datarootdir: ${datarootdir}") |
| 36 | list(APPEND final_message "Datadir: ${datadir}") | 36 | list(APPEND final_message "Datadir: ${datadir}") |
| 37 | list(APPEND final_message "Docdir: ${docdir}") | ||
| 37 | 38 | ||
| 38 | set(PATH_DEFINES -DBIN_INSTALL_PATH=\"${libdir}/kodi\" | 39 | set(PATH_DEFINES -DBIN_INSTALL_PATH=\"${libdir}/kodi\" |
| 39 | -DINSTALL_PATH=\"${datarootdir}/kodi\") | 40 | -DINSTALL_PATH=\"${datarootdir}/kodi\") |
diff --git a/project/cmake/scripts/osx/Macros.cmake b/project/cmake/scripts/osx/Macros.cmake index 52f87d1..0d04439 100644 --- a/project/cmake/scripts/osx/Macros.cmake +++ b/project/cmake/scripts/osx/Macros.cmake | |||
| @@ -2,7 +2,7 @@ function(core_link_library lib wraplib) | |||
| 2 | if(CMAKE_GENERATOR MATCHES "Unix Makefiles" OR CMAKE_GENERATOR STREQUAL Ninja) | 2 | if(CMAKE_GENERATOR MATCHES "Unix Makefiles" OR CMAKE_GENERATOR STREQUAL Ninja) |
| 3 | set(wrapper_obj cores/dll-loader/exports/CMakeFiles/wrapper.dir/wrapper.c.o) | 3 | set(wrapper_obj cores/dll-loader/exports/CMakeFiles/wrapper.dir/wrapper.c.o) |
| 4 | elseif(CMAKE_GENERATOR MATCHES "Xcode") | 4 | elseif(CMAKE_GENERATOR MATCHES "Xcode") |
| 5 | set(wrapper_obj cores/dll-loader/exports/kodi.build/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/wrapper.build/Objects-$(CURRENT_VARIANT)/$(CURRENT_ARCH)/wrapper.o) | 5 | set(wrapper_obj cores/dll-loader/exports/kodi.build/$(CONFIGURATION)/wrapper.build/Objects-$(CURRENT_VARIANT)/$(CURRENT_ARCH)/wrapper.o) |
| 6 | else() | 6 | else() |
| 7 | message(FATAL_ERROR "Unsupported generator in core_link_library") | 7 | message(FATAL_ERROR "Unsupported generator in core_link_library") |
| 8 | endif() | 8 | endif() |
| @@ -17,13 +17,6 @@ function(core_link_library lib wraplib) | |||
| 17 | set(link_lib $<TARGET_FILE:${lib}>) | 17 | set(link_lib $<TARGET_FILE:${lib}>) |
| 18 | set(check_arg ${ARGV2}) | 18 | set(check_arg ${ARGV2}) |
| 19 | set(data_arg ${ARGV3}) | 19 | set(data_arg ${ARGV3}) |
| 20 | |||
| 21 | # iOS: EFFECTIVE_PLATFORM_NAME is not resolved | ||
| 22 | # http://public.kitware.com/pipermail/cmake/2016-March/063049.html | ||
| 23 | if(CORE_SYSTEM_NAME STREQUAL ios AND CMAKE_GENERATOR STREQUAL Xcode) | ||
| 24 | get_target_property(dir ${lib} BINARY_DIR) | ||
| 25 | set(link_lib ${dir}/${CORE_BUILD_CONFIG}/${CMAKE_STATIC_LIBRARY_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX}) | ||
| 26 | endif() | ||
| 27 | else() | 20 | else() |
| 28 | set(target ${ARGV2}) | 21 | set(target ${ARGV2}) |
| 29 | set(link_lib ${lib}) | 22 | set(link_lib ${lib}) |
diff --git a/project/cmake/scripts/windows/tools/patch.cmake b/project/cmake/scripts/windows/tools/patch.cmake deleted file mode 100644 index 0ef2952..0000000 --- a/project/cmake/scripts/windows/tools/patch.cmake +++ /dev/null | |||
| @@ -1,37 +0,0 @@ | |||
| 1 | find_program(PATCH_FOUND NAMES patch patch.exe) | ||
| 2 | if(PATCH_FOUND) | ||
| 3 | message(STATUS "patch utility found at ${PATCH_FOUND}") | ||
| 4 | else() | ||
| 5 | set(PATCH_ARCHIVE_NAME "patch-2.5.9-7-bin-1") | ||
| 6 | set(PATCH_ARCHIVE "${PATCH_ARCHIVE_NAME}.zip") | ||
| 7 | set(PATCH_URL "${KODI_MIRROR}/build-deps/win32/${PATCH_ARCHIVE}") | ||
| 8 | set(PATCH_DOWNLOAD ${BUILD_DIR}/download/${PATCH_ARCHIVE}) | ||
| 9 | |||
| 10 | # download the archive containing patch.exe | ||
| 11 | message(STATUS "Downloading patch utility from ${PATCH_URL}...") | ||
| 12 | file(DOWNLOAD "${PATCH_URL}" "${PATCH_DOWNLOAD}" STATUS PATCH_DL_STATUS LOG PATCH_LOG SHOW_PROGRESS) | ||
| 13 | list(GET PATCH_DL_STATUS 0 PATCH_RETCODE) | ||
| 14 | if(NOT PATCH_RETCODE EQUAL 0) | ||
| 15 | message(FATAL_ERROR "ERROR downloading ${PATCH_URL} - status: ${PATCH_DL_STATUS} log: ${PATCH_LOG}") | ||
| 16 | endif() | ||
| 17 | |||
| 18 | # extract the archive containing patch.exe | ||
| 19 | execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzvf ${PATCH_DOWNLOAD} | ||
| 20 | WORKING_DIRECTORY ${BUILD_DIR}) | ||
| 21 | |||
| 22 | # make sure the extraction worked and that patch.exe is there | ||
| 23 | set(PATCH_PATH ${BUILD_DIR}/${PATCH_ARCHIVE_NAME}) | ||
| 24 | set(PATCH_BINARY_PATH ${PATCH_PATH}/bin/patch.exe) | ||
| 25 | if(NOT EXISTS ${PATCH_PATH} OR NOT EXISTS ${PATCH_BINARY_PATH}) | ||
| 26 | message(FATAL_ERROR "ERROR extracting patch utility from ${PATCH_PATH}") | ||
| 27 | endif() | ||
| 28 | |||
| 29 | # copy patch.exe into the output directory | ||
| 30 | file(INSTALL ${PATCH_BINARY_PATH} DESTINATION ${ADDON_DEPENDS_PATH}/bin) | ||
| 31 | |||
| 32 | # make sure that cmake can find the copied patch.exe | ||
| 33 | find_program(PATCH_FOUND NAMES patch patch.exe) | ||
| 34 | if(NOT PATCH_FOUND) | ||
| 35 | message(FATAL_ERROR "ERROR installing patch utility from ${PATCH_BINARY_PATH} to ${ADDON_DEPENDS_PATH}/bin") | ||
| 36 | endif() | ||
| 37 | endif() | ||
