From f8d51951c05462f98ab120573bb8b58d15943c66 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Fri, 21 Jul 2017 05:23:07 +0200 Subject: cmake: Prepare script for 'dist'-like targets 'dist' is the same as before only difference: add date and commit hash for development and pre-release --- CMakeScripts/Dist.cmake | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 CMakeScripts/Dist.cmake (limited to 'CMakeScripts/Dist.cmake') diff --git a/CMakeScripts/Dist.cmake b/CMakeScripts/Dist.cmake new file mode 100644 index 000000000..21d233d87 --- /dev/null +++ b/CMakeScripts/Dist.cmake @@ -0,0 +1,24 @@ +# dist targets for various platforms + +set(INKSCAPE_DIST_PREFIX "${PROJECT_NAME}-${INKSCAPE_VERSION}") + +# get INKSCAPE_REVISION of the source +set(INKSCAPE_SOURCE_DIR ${CMAKE_SOURCE_DIR}) +include(CMakeScripts/inkscape-version.cmake) + +if(INKSCAPE_VERSION_SUFFIX AND INKSCAPE_REVISION_DATE AND INKSCAPE_REVISION_HASH) + set(INKSCAPE_DIST_PREFIX ${INKSCAPE_DIST_PREFIX}_${INKSCAPE_REVISION_DATE}_${INKSCAPE_REVISION_HASH}) +endif() + + +# ----------------------------------------------------------------------------- +# 'dist' - generate source release tarball +# ----------------------------------------------------------------------------- + +add_custom_target(dist + COMMAND sed -i "s/unknown/${INKSCAPE_REVISION}/" CMakeScripts/inkscape-version.cmake + && tar cfz ${CMAKE_BINARY_DIR}/${INKSCAPE_DIST_PREFIX}.tar.gz ${CMAKE_SOURCE_DIR}/doc --exclude=".*" --exclude-vcs-ignores + || git checkout ${CMAKE_SOURCE_DIR}/CMakeScripts/inkscape-version.cmake + COMMAND git checkout ${CMAKE_SOURCE_DIR}/CMakeScripts/inkscape-version.cmake # duplicate to make sure we actually revert in case of error + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" + VERBATIM) -- cgit v1.2.3