Commit 7811297f authored by Marc Jeanmougin's avatar Marc Jeanmougin 🚀

Fix revno with git

parent e4ed7cef
......@@ -152,21 +152,22 @@ endif()
# Dist Target
# -----------------------------------------------------------------------------
if(EXISTS ${CMAKE_SOURCE_DIR}/.git/)
execute_process(COMMAND
git describe
execute_process(
COMMAND git show --format=format:"%ad %h" --date=short
COMMAND head -n 1
COMMAND tr "\n" " "
OUTPUT_VARIABLE INKSCAPE_REVISION
OUTPUT_STRIP_TRAILING_WHITESPACE)
else()
set(INKSCAPE_REVISION "unknown")
endif()
set(INKSCAPE_DIST_PREFIX "${PROJECT_NAME}-${INKSCAPE_VERSION}")
#add_custom_target(dist
# COMMAND sed -i "s/unknown/r${INKSCAPE_REVISION}/" CMakeScripts/inkscape-version.cmake
# && sed -i "s/custom//" CMakeScripts/inkscape-version.cmake
# && bzr export --uncommitted --root=${INKSCAPE_DIST_PREFIX}
# "${CMAKE_BINARY_DIR}/${INKSCAPE_DIST_PREFIX}.tar.bz2"
# && bzr revert ${CMAKE_SOURCE_DIR}/CMakeScripts/inkscape-version.cmake
# WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
add_custom_target(dist
COMMAND sed -i "s/unknown//" CMakeScripts/inkscape-version.cmake
&& sed -i "s/custom//" CMakeScripts/inkscape-version.cmake
&& tar cfz ${CMAKE_BINARY_DIR}/${INKSCAPE_DIST_PREFIX}.tar.gz ${CMAKE_SOURCE_DIR} --exclude=".*" --exclude-vcs-ignores
&& git checkout ${CMAKE_SOURCE_DIR}/CMakeScripts/inkscape-version.cmake
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
# -----------------------------------------------------------------------------
# Uninstall Target
......
......@@ -12,10 +12,18 @@ set(INKSCAPE_REVISION "unknown")
set(INKSCAPE_CUSTOM "custom")
if(EXISTS ${INKSCAPE_SOURCE_DIR}/.git/)
execute_process(COMMAND
git describe ${INKSCAPE_SOURCE_DIR}
OUTPUT_VARIABLE INKSCAPE_REVISION
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND git describe
COMMAND tr "\n" " "
WORKING_DIRECTORY ${INKSCAPE_SOURCE_DIR}
OUTPUT_VARIABLE INKSCAPE_REV1)
execute_process(COMMAND git show --format=format:%ad --date=short
COMMAND head -n 1
COMMAND tr "\n" " "
WORKING_DIRECTORY ${INKSCAPE_SOURCE_DIR}
OUTPUT_VARIABLE INKSCAPE_REV2
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(INKSCAPE_REVISION ${INKSCAPE_REV1} ${INKSCAPE_REV2})
execute_process(COMMAND
git status -s ${INKSCAPE_SOURCE_DIR}/src
......
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