From 9fc8b732737f139d3e466510d75668ab45578960 Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 8 Mar 2016 21:02:53 +0100 Subject: sync with upstream --- project/cmake/scripts/common/prepare-env.cmake | 33 ++++++++++++++++---------- 1 file changed, 20 insertions(+), 13 deletions(-) (limited to 'project/cmake/scripts/common/prepare-env.cmake') 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") set(${name} "${value}") endif() endforeach() + string(TOLOWER ${APP_NAME} APP_NAME_LC) + string(TOUPPER ${APP_NAME} APP_NAME_UC) endif() # bail if we can't parse versions @@ -19,16 +21,21 @@ if(NOT DEFINED APP_VERSION_MAJOR OR NOT DEFINED APP_VERSION_MINOR) message(FATAL_ERROR "Could not determine app version! make sure that ${APP_ROOT}/version.txt exists") endif() +# in case we need to download something, set KODI_MIRROR to the default if not alread set +if(NOT DEFINED KODI_MIRROR) + set(KODI_MIRROR "http://mirrors.kodi.tv") +endif() + ### copy all the addon binding header files to include/kodi # make sure include/kodi exists and is empty -set(KODI_LIB_DIR ${DEPENDS_PATH}/lib/kodi) -if(NOT EXISTS "${KODI_LIB_DIR}/") - file(MAKE_DIRECTORY ${KODI_LIB_DIR}) +set(APP_LIB_DIR ${DEPENDS_PATH}/lib/${APP_NAME_LC}) +if(NOT EXISTS "${APP_LIB_DIR}/") + file(MAKE_DIRECTORY ${APP_LIB_DIR}) endif() -set(KODI_INCLUDE_DIR ${DEPENDS_PATH}/include/kodi) -if(NOT EXISTS "${KODI_INCLUDE_DIR}/") - file(MAKE_DIRECTORY ${KODI_INCLUDE_DIR}) +set(APP_INCLUDE_DIR ${DEPENDS_PATH}/include/${APP_NAME_LC}) +if(NOT EXISTS "${APP_INCLUDE_DIR}/") + file(MAKE_DIRECTORY ${APP_INCLUDE_DIR}) endif() # we still need XBMC_INCLUDE_DIR and XBMC_LIB_DIR for backwards compatibility to xbmc @@ -49,13 +56,13 @@ if(NOT WIN32) endif() endif() -# kodi-config.cmake.in (further down) expects a "prefix" variable -get_filename_component(prefix "${DEPENDS_PATH}" ABSOLUTE) - # generate the proper kodi-config.cmake file -configure_file(${APP_ROOT}/project/cmake/kodi-config.cmake.in ${KODI_LIB_DIR}/kodi-config.cmake @ONLY) +configure_file(${APP_ROOT}/project/cmake/kodi-config.cmake.in ${APP_LIB_DIR}/kodi-config.cmake @ONLY) + # copy cmake helpers to lib/kodi -file(COPY ${APP_ROOT}/project/cmake/scripts/common/addon-helpers.cmake ${APP_ROOT}/project/cmake/scripts/common/addoptions.cmake DESTINATION ${KODI_LIB_DIR}) +file(COPY ${APP_ROOT}/project/cmake/scripts/common/addon-helpers.cmake + ${APP_ROOT}/project/cmake/scripts/common/addoptions.cmake + DESTINATION ${APP_LIB_DIR}) # generate xbmc-config.cmake for backwards compatibility to xbmc configure_file(${APP_ROOT}/project/cmake/xbmc-config.cmake.in ${XBMC_LIB_DIR}/xbmc-config.cmake @ONLY) @@ -69,7 +76,7 @@ foreach(binding ${bindings}) string(REPLACE "+=" ";" binding "${binding}") list(GET binding 1 header) # copy the header file to include/kodi - file(COPY ${APP_ROOT}/${header} DESTINATION ${KODI_INCLUDE_DIR}) + file(COPY ${APP_ROOT}/${header} DESTINATION ${APP_INCLUDE_DIR}) # auto-generate header files for backwards compatibility to xbmc with deprecation warning # but only do it if the file doesn't already exist @@ -95,7 +102,7 @@ if(WIN32) else() set(PATCH_ARCHIVE_NAME "patch-2.5.9-7-bin-1") set(PATCH_ARCHIVE "${PATCH_ARCHIVE_NAME}.zip") - set(PATCH_URL "http://mirrors.xbmc.org/build-deps/win32/${PATCH_ARCHIVE}") + set(PATCH_URL "${KODI_MIRROR}/build-deps/win32/${PATCH_ARCHIVE}") set(PATCH_DOWNLOAD ${BUILD_DIR}/download/${PATCH_ARCHIVE}) # download the archive containing patch.exe -- cgit v1.2.3