aboutsummaryrefslogtreecommitdiff
path: root/project
diff options
context:
space:
mode:
authormontellese <montellese@xbmc.org>2014-08-05 13:39:58 +0200
committermontellese <montellese@xbmc.org>2014-08-05 13:39:58 +0200
commitc96e2203fcb039ca5f5e533adfe2794eea45df8b (patch)
treebbc249d6c05fd8874bbe2e29a19067f9b094f5ad /project
parent4b91927d37095eefb0830fd9d0e3f4a88777d34d (diff)
binary addons: allow downloading addons as source packages instead of git repositories
Diffstat (limited to 'project')
-rw-r--r--project/cmake/addons/CMakeLists.txt30
1 files changed, 21 insertions, 9 deletions
diff --git a/project/cmake/addons/CMakeLists.txt b/project/cmake/addons/CMakeLists.txt
index edabd879dc..6593be5657 100644
--- a/project/cmake/addons/CMakeLists.txt
+++ b/project/cmake/addons/CMakeLists.txt
@@ -116,17 +116,29 @@ foreach(addon ${addons})
file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/${id}/")
endif()
+ # prepare the setup of the call to externalproject_add()
+ set(EXTERNALPROJECT_SETUP INSTALL_DIR "${CMAKE_INSTALL_PREFIX}"
+ CMAKE_ARGS ${BUILD_ARGS})
+
# get the URL and revision of the addon
+ list(LENGTH def deflength)
list(GET def 1 url)
- list(GET def 2 revision)
-
- # add the addon as an external project for automatic building
- externalproject_add(${id}
- GIT_REPOSITORY ${url}
- GIT_TAG ${revision}
- INSTALL_DIR "${CMAKE_INSTALL_PREFIX}"
- CMAKE_ARGS ${BUILD_ARGS}
- )
+ # check if there's a third parameter in the file
+ if(deflength GREATER 2)
+ # the third parameter is considered as a revision of a git repository
+ list(GET def 2 revision)
+
+ externalproject_add(${id}
+ GIT_REPOSITORY ${url}
+ GIT_TAG ${revision}
+ "${EXTERNALPROJECT_SETUP}"
+ )
+ else()
+ externalproject_add(${id}
+ URL ${url}
+ "${EXTERNALPROJECT_SETUP}"
+ )
+ endif()
endif()
endif()
endif()