From a3a72089f703dae0b03a5d8cc7d1e2ddec0bad0b Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sun, 5 Nov 2017 14:34:28 +0100 Subject: [PATCH] cmake: Allow customized prefix and suffix for packaging --- CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d2236a0..0ad1e8d0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,12 @@ configure_file( math(EXPR BITS "8*${CMAKE_SIZEOF_VOID_P}") 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 @@ -161,13 +167,13 @@ else() # Zip Generator 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 WORKING_DIRECTORY "${INSTALL_DIR}") # 7-Zip Generator 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 WORKING_DIRECTORY "${INSTALL_DIR}")