diff options
Diffstat (limited to 'project/cmake/scripts/common/prepare-env.cmake')
| -rw-r--r-- | project/cmake/scripts/common/prepare-env.cmake | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/project/cmake/scripts/common/prepare-env.cmake b/project/cmake/scripts/common/prepare-env.cmake index 3413c45..b9a39e7 100644 --- a/project/cmake/scripts/common/prepare-env.cmake +++ b/project/cmake/scripts/common/prepare-env.cmake | |||
| @@ -12,6 +12,8 @@ if(EXISTS "${APP_ROOT}/version.txt") | |||
| 12 | set(${name} "${value}") | 12 | set(${name} "${value}") |
| 13 | endif() | 13 | endif() |
| 14 | endforeach() | 14 | endforeach() |
| 15 | string(TOLOWER ${APP_NAME} APP_NAME_LC) | ||
| 16 | string(TOUPPER ${APP_NAME} APP_NAME_UC) | ||
| 15 | endif() | 17 | endif() |
| 16 | 18 | ||
| 17 | # bail if we can't parse versions | 19 | # bail if we can't parse versions |
| @@ -19,16 +21,21 @@ if(NOT DEFINED APP_VERSION_MAJOR OR NOT DEFINED APP_VERSION_MINOR) | |||
| 19 | message(FATAL_ERROR "Could not determine app version! make sure that ${APP_ROOT}/version.txt exists") | 21 | message(FATAL_ERROR "Could not determine app version! make sure that ${APP_ROOT}/version.txt exists") |
| 20 | endif() | 22 | endif() |
| 21 | 23 | ||
| 24 | # in case we need to download something, set KODI_MIRROR to the default if not alread set | ||
| 25 | if(NOT DEFINED KODI_MIRROR) | ||
| 26 | set(KODI_MIRROR "http://mirrors.kodi.tv") | ||
| 27 | endif() | ||
| 28 | |||
| 22 | ### copy all the addon binding header files to include/kodi | 29 | ### copy all the addon binding header files to include/kodi |
| 23 | # make sure include/kodi exists and is empty | 30 | # make sure include/kodi exists and is empty |
| 24 | set(KODI_LIB_DIR ${DEPENDS_PATH}/lib/kodi) | 31 | set(APP_LIB_DIR ${DEPENDS_PATH}/lib/${APP_NAME_LC}) |
| 25 | if(NOT EXISTS "${KODI_LIB_DIR}/") | 32 | if(NOT EXISTS "${APP_LIB_DIR}/") |
| 26 | file(MAKE_DIRECTORY ${KODI_LIB_DIR}) | 33 | file(MAKE_DIRECTORY ${APP_LIB_DIR}) |
| 27 | endif() | 34 | endif() |
| 28 | 35 | ||
| 29 | set(KODI_INCLUDE_DIR ${DEPENDS_PATH}/include/kodi) | 36 | set(APP_INCLUDE_DIR ${DEPENDS_PATH}/include/${APP_NAME_LC}) |
| 30 | if(NOT EXISTS "${KODI_INCLUDE_DIR}/") | 37 | if(NOT EXISTS "${APP_INCLUDE_DIR}/") |
| 31 | file(MAKE_DIRECTORY ${KODI_INCLUDE_DIR}) | 38 | file(MAKE_DIRECTORY ${APP_INCLUDE_DIR}) |
| 32 | endif() | 39 | endif() |
| 33 | 40 | ||
| 34 | # we still need XBMC_INCLUDE_DIR and XBMC_LIB_DIR for backwards compatibility to xbmc | 41 | # we still need XBMC_INCLUDE_DIR and XBMC_LIB_DIR for backwards compatibility to xbmc |
| @@ -49,13 +56,13 @@ if(NOT WIN32) | |||
| 49 | endif() | 56 | endif() |
| 50 | endif() | 57 | endif() |
| 51 | 58 | ||
| 52 | # kodi-config.cmake.in (further down) expects a "prefix" variable | ||
| 53 | get_filename_component(prefix "${DEPENDS_PATH}" ABSOLUTE) | ||
| 54 | |||
| 55 | # generate the proper kodi-config.cmake file | 59 | # generate the proper kodi-config.cmake file |
| 56 | configure_file(${APP_ROOT}/project/cmake/kodi-config.cmake.in ${KODI_LIB_DIR}/kodi-config.cmake @ONLY) | 60 | configure_file(${APP_ROOT}/project/cmake/kodi-config.cmake.in ${APP_LIB_DIR}/kodi-config.cmake @ONLY) |
| 61 | |||
| 57 | # copy cmake helpers to lib/kodi | 62 | # copy cmake helpers to lib/kodi |
| 58 | file(COPY ${APP_ROOT}/project/cmake/scripts/common/addon-helpers.cmake ${APP_ROOT}/project/cmake/scripts/common/addoptions.cmake DESTINATION ${KODI_LIB_DIR}) | 63 | file(COPY ${APP_ROOT}/project/cmake/scripts/common/addon-helpers.cmake |
| 64 | ${APP_ROOT}/project/cmake/scripts/common/addoptions.cmake | ||
| 65 | DESTINATION ${APP_LIB_DIR}) | ||
| 59 | 66 | ||
| 60 | # generate xbmc-config.cmake for backwards compatibility to xbmc | 67 | # generate xbmc-config.cmake for backwards compatibility to xbmc |
| 61 | configure_file(${APP_ROOT}/project/cmake/xbmc-config.cmake.in ${XBMC_LIB_DIR}/xbmc-config.cmake @ONLY) | 68 | configure_file(${APP_ROOT}/project/cmake/xbmc-config.cmake.in ${XBMC_LIB_DIR}/xbmc-config.cmake @ONLY) |
| @@ -69,7 +76,7 @@ foreach(binding ${bindings}) | |||
| 69 | string(REPLACE "+=" ";" binding "${binding}") | 76 | string(REPLACE "+=" ";" binding "${binding}") |
| 70 | list(GET binding 1 header) | 77 | list(GET binding 1 header) |
| 71 | # copy the header file to include/kodi | 78 | # copy the header file to include/kodi |
| 72 | file(COPY ${APP_ROOT}/${header} DESTINATION ${KODI_INCLUDE_DIR}) | 79 | file(COPY ${APP_ROOT}/${header} DESTINATION ${APP_INCLUDE_DIR}) |
| 73 | 80 | ||
| 74 | # auto-generate header files for backwards compatibility to xbmc with deprecation warning | 81 | # auto-generate header files for backwards compatibility to xbmc with deprecation warning |
| 75 | # but only do it if the file doesn't already exist | 82 | # but only do it if the file doesn't already exist |
| @@ -95,7 +102,7 @@ if(WIN32) | |||
| 95 | else() | 102 | else() |
| 96 | set(PATCH_ARCHIVE_NAME "patch-2.5.9-7-bin-1") | 103 | set(PATCH_ARCHIVE_NAME "patch-2.5.9-7-bin-1") |
| 97 | set(PATCH_ARCHIVE "${PATCH_ARCHIVE_NAME}.zip") | 104 | set(PATCH_ARCHIVE "${PATCH_ARCHIVE_NAME}.zip") |
| 98 | set(PATCH_URL "http://mirrors.xbmc.org/build-deps/win32/${PATCH_ARCHIVE}") | 105 | set(PATCH_URL "${KODI_MIRROR}/build-deps/win32/${PATCH_ARCHIVE}") |
| 99 | set(PATCH_DOWNLOAD ${BUILD_DIR}/download/${PATCH_ARCHIVE}) | 106 | set(PATCH_DOWNLOAD ${BUILD_DIR}/download/${PATCH_ARCHIVE}) |
| 100 | 107 | ||
| 101 | # download the archive containing patch.exe | 108 | # download the archive containing patch.exe |
