aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormontellese <montellese@kodi.tv>2015-07-29 19:56:04 +0200
committermontellese <montellese@kodi.tv>2015-07-29 19:57:00 +0200
commit6b37aa6a2b9928da8b10e737262879550b86d6c5 (patch)
tree96e48382d6ce7fe747f114a4adb5ab2ca7ca94e4
parent11e3352a147d7d4aac160705d9eadd188d6699f4 (diff)
[binary addons] introduce PACKAGE_DIR variable to be able to specify where packaged addon archives should be copied to
-rw-r--r--project/cmake/addons/CMakeLists.txt11
-rw-r--r--project/cmake/addons/README2
-rw-r--r--project/cmake/scripts/common/addon-helpers.cmake8
3 files changed, 18 insertions, 3 deletions
diff --git a/project/cmake/addons/CMakeLists.txt b/project/cmake/addons/CMakeLists.txt
index 49f7663249..821f70b63f 100644
--- a/project/cmake/addons/CMakeLists.txt
+++ b/project/cmake/addons/CMakeLists.txt
@@ -82,7 +82,16 @@ option(PACKAGE_ZIP "Prepare built addons for packaging" OFF)
if(PACKAGE_ZIP)
# needed for project installing
list(APPEND BUILD_ARGS -DPACKAGE_ZIP=ON)
- MESSAGE(STATUS "ZIP packaging enabled")
+
+ # figure out where to store the packaged ZIP archives
+ if(NOT PACKAGE_DIR)
+ set(PACKAGE_DIR "${BUILD_DIR}/zips")
+ else()
+ file(TO_CMAKE_PATH "${CMAKE_PREFIX_PATH}" CMAKE_PREFIX_PATH)
+ endif()
+ list(APPEND BUILD_ARGS -DPACKAGE_DIR=${PACKAGE_DIR})
+
+ MESSAGE(STATUS "ZIP packaging enabled (destination: ${PACKAGE_DIR}})")
endif()
if(CMAKE_TOOLCHAIN_FILE)
diff --git a/project/cmake/addons/README b/project/cmake/addons/README
index 4f34a70158..d348dfcf1b 100644
--- a/project/cmake/addons/README
+++ b/project/cmake/addons/README
@@ -48,6 +48,8 @@ specific paths:
* PACKAGE_ZIP=ON means that the add-ons will be 'packaged' into a common folder,
rather than being placed in <CMAKE_INSTALL_PREFIX>/lib/kodi/addons and
<CMAKE_INSTALL_PREFIX>/share/kodi/addons.
+ * PACKAGE_DIR points to the directory where the ZIP archived addons will be
+ stored after they have been packaged (defaults to <BUILD_DIR>/zips)
* ARCH_DEFINES specifies the platform-specific C/C++ preprocessor defines
(defaults to empty).
diff --git a/project/cmake/scripts/common/addon-helpers.cmake b/project/cmake/scripts/common/addon-helpers.cmake
index e6b6203490..0e6b9dc24b 100644
--- a/project/cmake/scripts/common/addon-helpers.cmake
+++ b/project/cmake/scripts/common/addon-helpers.cmake
@@ -10,10 +10,14 @@ add_custom_target(addon-package
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target package)
macro(add_cpack_workaround target version ext)
+ if(NOT PACKAGE_DIR)
+ set(PACKAGE_DIR "${CMAKE_INSTALL_PREFIX}/zips")
+ endif()
+
add_custom_command(TARGET addon-package PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_BINARY_DIR}/addon-${target}-${version}.${ext} ${CMAKE_BINARY_DIR}/${target}-${version}.${ext}
- COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_INSTALL_PREFIX}/zip
- COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/${target}-${version}.${ext} ${CMAKE_INSTALL_PREFIX}/zip)
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${PACKAGE_DIR}
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/${target}-${version}.${ext} ${PACKAGE_DIR})
endmacro()
# Grab the version from a given add-on's addon.xml