cmake: Allow customized prefix and suffix for packaging

This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2017-11-05 14:34:28 +01:00
parent b1f1942179
commit a3a72089f7

View file

@ -20,6 +20,12 @@ configure_file(
math(EXPR BITS "8*${CMAKE_SIZEOF_VOID_P}") math(EXPR BITS "8*${CMAKE_SIZEOF_VOID_P}")
SET(INSTALL_DIR "${PROJECT_BINARY_DIR}/distribute" CACHE PATH "Installation directory") SET(INSTALL_DIR "${PROJECT_BINARY_DIR}/distribute" CACHE PATH "Installation directory")
IF(NOT DEFINED PACKAGE_PREFIX)
SET(PACKAGE_PREFIX "")
ENDIF()
IF(NOT DEFINED PACKAGE_SUFFIX)
SET(PACKAGE_SUFFIX ".${VERSION_STR}")
ENDIF()
################################################################################ ################################################################################
# Code # Code
@ -161,13 +167,13 @@ else()
# Zip Generator # Zip Generator
ADD_CUSTOM_TARGET(PACKAGE_ZIP COMMAND ADD_CUSTOM_TARGET(PACKAGE_ZIP COMMAND
${CMAKE_COMMAND} -E tar "cfv" "${INSTALL_DIR}/obs-stream-effects.${VERSION_STR}.zip" --format=zip -- "${INSTALL_DIR}/data/" "${INSTALL_DIR}/obs-plugins" ${CMAKE_COMMAND} -E tar "cfv" "${INSTALL_DIR}/${PACKAGE_PREFIX}obs-stream-effects${PACKAGE_SUFFIX}.zip" --format=zip -- "${INSTALL_DIR}/data/" "${INSTALL_DIR}/obs-plugins"
DEPENDS INSTALL obs-stream-effects DEPENDS INSTALL obs-stream-effects
WORKING_DIRECTORY "${INSTALL_DIR}") WORKING_DIRECTORY "${INSTALL_DIR}")
# 7-Zip Generator # 7-Zip Generator
ADD_CUSTOM_TARGET(PACKAGE_7ZIP COMMAND ADD_CUSTOM_TARGET(PACKAGE_7ZIP COMMAND
${CMAKE_COMMAND} -E tar "cfv" "${INSTALL_DIR}/obs-stream-effects.${VERSION_STR}.7z" --format=7zip -- "${INSTALL_DIR}/data/" "${INSTALL_DIR}/obs-plugins" ${CMAKE_COMMAND} -E tar "cfv" "${INSTALL_DIR}/${PACKAGE_PREFIX}obs-stream-effects${PACKAGE_SUFFIX}.7z" --format=7zip -- "${INSTALL_DIR}/data/" "${INSTALL_DIR}/obs-plugins"
DEPENDS INSTALL obs-stream-effects DEPENDS INSTALL obs-stream-effects
WORKING_DIRECTORY "${INSTALL_DIR}") WORKING_DIRECTORY "${INSTALL_DIR}")