aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwsnipex <wsnipex@a1.net>2015-03-03 11:04:12 +0100
committermontellese <montellese@xbmc.org>2015-03-03 15:00:58 +0100
commit09826ab84fa84d244c6747e309d07febaa5a7085 (patch)
tree38c90778d05afb6a9f6fb673be12419c1bdb526f
parent49e90264bc1311535e3e2d3d4c5d19af2ea673db (diff)
cmake: allow to override local addon location via ADDON_SRC_PREFIX
-rw-r--r--project/cmake/addons/CMakeLists.txt17
-rw-r--r--project/cmake/addons/README3
2 files changed, 16 insertions, 4 deletions
diff --git a/project/cmake/addons/CMakeLists.txt b/project/cmake/addons/CMakeLists.txt
index 6b22fa2e23..0dad18d675 100644
--- a/project/cmake/addons/CMakeLists.txt
+++ b/project/cmake/addons/CMakeLists.txt
@@ -92,6 +92,10 @@ else()
separate_arguments(ADDONS_TO_BUILD)
endif()
+if(ADDON_SRC_PREFIX)
+ message(STATUS "Overriding addon source directory prefix: ${ADDON_SRC_PREFIX}")
+endif()
+
if(NOT KODI_LIB_DIR)
set(KODI_LIB_DIR "${DEPENDS_PATH}/lib/kodi")
else()
@@ -160,17 +164,22 @@ foreach(addon ${addons})
list(GET def 1 url)
set(archive_name ${id})
- set(SOURCE_DIR "")
+ if(ADDON_SRC_PREFIX)
+ set(SOURCE_DIR ${ADDON_SRC_PREFIX}/${id})
+ set(archive_name "")
+ else()
+ set(SOURCE_DIR "")
+ endif()
- # if there is a 3rd parameter in the file, we consider it a git revision
- if(deflength GREATER 2)
+ # if there is a 3rd parameter in the file, we consider it a git revision
+ if(deflength GREATER 2 AND "${SOURCE_DIR}" STREQUAL "")
list(GET def 2 revision)
# Note: downloading specific revisions via http in the format below is probably github specific
# if we ever use other repositories, this might need adapting
set(url ${url}/archive/${revision}.tar.gz)
set(archive_name ${archive_name}-${revision})
- else()
+ elseif("${SOURCE_DIR}" STREQUAL "")
# check if the URL starts with file://
string(REGEX MATCH "^file://.*$" local_url "${url}")
diff --git a/project/cmake/addons/README b/project/cmake/addons/README
index 2e6b46ad44..b901bb7a7b 100644
--- a/project/cmake/addons/README
+++ b/project/cmake/addons/README
@@ -29,6 +29,9 @@ executing cmake with the -D<variable-name>=<value> option) to e.g. access
specific paths:
* ADDONS_TO_BUILD is a quoted, space delimited list of <addon-id>s that
you want to build (default is "all").
+ * ADDON_SRC_PREFIX can be used to override the addon repository location.
+ It must point to the locally available parent directory of the addon(s) to build
+ <addon-id> will be appended to this path automatically
* CMAKE_BUILD_TYPE specifies the type of the build. This can be either "Debug"
or "Release" (default is "Release").
* CMAKE_INSTALL_PREFIX points to the directory where the built addons and their