CPack: Use hash of the head for the file name

Upstream is not always configured ad might give empty results.

Ideally we need to re-use the same code as we use for buildinfo,
but it's also a bit of a question which exact hash we want to put
to the name by default.
This commit is contained in:
Sergey Sharybin 2015-07-27 12:18:45 +02:00
parent ce092a58a2
commit e355d557f8

@ -24,7 +24,7 @@ if(EXISTS ${CMAKE_SOURCE_DIR}/.git/)
include(FindGit) include(FindGit)
if(GIT_FOUND) if(GIT_FOUND)
message(STATUS "-- Found Git: ${GIT_EXECUTABLE}") message(STATUS "-- Found Git: ${GIT_EXECUTABLE}")
execute_process(COMMAND git rev-parse --short @{u} execute_process(COMMAND git rev-parse --short HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE MY_WC_HASH OUTPUT_VARIABLE MY_WC_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE