diff options
| author | Eduard Braun <eduard.braun2@gmx.de> | 2017-07-21 03:23:07 +0000 |
|---|---|---|
| committer | Eduard Braun <eduard.braun2@gmx.de> | 2017-07-23 01:49:14 +0000 |
| commit | f8d51951c05462f98ab120573bb8b58d15943c66 (patch) | |
| tree | ca79dc588dba8adb1bee76c11cd8387ffc8689ca /CMakeScripts/Dist.cmake | |
| parent | Drop ChangeLog (diff) | |
| download | inkscape-f8d51951c05462f98ab120573bb8b58d15943c66.tar.gz inkscape-f8d51951c05462f98ab120573bb8b58d15943c66.zip | |
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
Diffstat (limited to 'CMakeScripts/Dist.cmake')
| -rw-r--r-- | CMakeScripts/Dist.cmake | 24 |
1 files changed, 24 insertions, 0 deletions
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) |
