Commit 8d5d7c34 authored by Milan Crha's avatar Milan Crha

Add a helper script for a 'dist' target

It verifies that the distribution tarball is created with all local
changes, which requires them to be committed. If there are uncommitted
changes, then it prints a warning on the console.
parent d17f923f
...@@ -18,6 +18,7 @@ set(ARCHIVE_BASE_NAME ${PROJECT_NAME}-${PROJECT_VERSION}) ...@@ -18,6 +18,7 @@ set(ARCHIVE_BASE_NAME ${PROJECT_NAME}-${PROJECT_VERSION})
set(ARCHIVE_FULL_NAME ${ARCHIVE_BASE_NAME}.tar.xz) set(ARCHIVE_FULL_NAME ${ARCHIVE_BASE_NAME}.tar.xz)
add_custom_target(dist add_custom_target(dist
COMMAND ${CMAKE_COMMAND} -E chdir . "${CMAKE_SOURCE_DIR}/cmake/verify-pre-dist.sh"
COMMAND ${CMAKE_COMMAND} -E echo "Creating '${ARCHIVE_FULL_NAME}'..." COMMAND ${CMAKE_COMMAND} -E echo "Creating '${ARCHIVE_FULL_NAME}'..."
COMMAND git archive --prefix=${ARCHIVE_BASE_NAME}/ HEAD | xz -z > ${CMAKE_BINARY_DIR}/${ARCHIVE_FULL_NAME} COMMAND git archive --prefix=${ARCHIVE_BASE_NAME}/ HEAD | xz -z > ${CMAKE_BINARY_DIR}/${ARCHIVE_FULL_NAME}
COMMAND ${CMAKE_COMMAND} -E echo "Distribution tarball '${ARCHIVE_FULL_NAME}' created at ${CMAKE_BINARY_DIR}" COMMAND ${CMAKE_COMMAND} -E echo "Distribution tarball '${ARCHIVE_FULL_NAME}' created at ${CMAKE_BINARY_DIR}"
......
#!/bin/bash
git diff --no-patch --exit-code HEAD
if [ ! $? -eq 0 ]; then
echo "" 1>&2
echo "***********************************************************************" 1>&2
echo " There are uncommitted changes which will not be part of the tarball " 1>&2
echo "***********************************************************************" 1>&2
echo "" 1>&2
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment