Revert changes to CreateGitVersionHeader.cmake that were causing configuration issues.

This commit is contained in:
Wayne Stambaugh 2015-09-14 08:45:25 -04:00
parent f7b8ac52e1
commit 463b8b4127
1 changed files with 6 additions and 32 deletions

View File

@ -40,28 +40,18 @@ macro( create_git_version_header _git_src_path )
${GIT_EXECUTABLE} --no-pager log -1 HEAD
--pretty=format:%H
WORKING_DIRECTORY ${_git_src_path}
OUTPUT_VARIABLE _git_LONG_HASH_ORIGIN
OUTPUT_VARIABLE _git_LONG_HASH
ERROR_VARIABLE _git_log_error
RESULT_VARIABLE _git_log_result
OUTPUT_STRIP_TRAILING_WHITESPACE)
if( ${_git_log_result} EQUAL 0 )
# Get origin/HEAD hash:
execute_process(
COMMAND
${GIT_EXECUTABLE} --no-pager log -1 origin/HEAD
--pretty=format:%h
WORKING_DIRECTORY ${_git_src_path}
OUTPUT_VARIABLE _git_SHORT_HASH_ORIGIN
OUTPUT_STRIP_TRAILING_WHITESPACE)
# Get local HEAD hash:
execute_process(
COMMAND
${GIT_EXECUTABLE} --no-pager log -1 HEAD
--pretty=format:%h
WORKING_DIRECTORY ${_git_src_path}
OUTPUT_VARIABLE _git_SHORT_HASH_LOCAL
OUTPUT_VARIABLE _git_SHORT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(
@ -80,29 +70,19 @@ macro( create_git_version_header _git_src_path )
OUTPUT_VARIABLE _git_LAST_CHANGE_LOG
OUTPUT_STRIP_TRAILING_WHITESPACE)
# Get origin Repo HEAD (matched official BZR number) Version Number:
execute_process(
COMMAND
${GIT_EXECUTABLE} rev-list origin/HEAD --count
--first-parent
WORKING_DIRECTORY ${_git_src_path}
OUTPUT_VARIABLE _git_SERIAL_ORIGIN
OUTPUT_STRIP_TRAILING_WHITESPACE)
# Get local Repo HEAD (matched official BZR number) Version Number:
execute_process(
COMMAND
${GIT_EXECUTABLE} rev-list HEAD --count
--first-parent
WORKING_DIRECTORY ${_git_src_path}
OUTPUT_VARIABLE _git_SERIAL_LOCAL
OUTPUT_VARIABLE _git_SERIAL
OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "Git hash: ${_git_LONG_HASH_ORIGIN}")
message(STATUS "Git hash: ${_git_LONG_HASH}")
if( ${_git_log_result} EQUAL 0 )
string( REGEX REPLACE "^(.*\n)?revno: ([^ \n]+).*"
"\\2" Kicad_REPO_REVISION "BZR ${_git_SERIAL_ORIGIN}, Git ${_git_SHORT_HASH_ORIGIN}" )
"\\2" Kicad_REPO_REVISION "BZR ${_git_SERIAL}, Git ${_git_SHORT_HASH}" )
string( REGEX REPLACE "^(.*\n)?committer: ([^\n]+).*"
"\\2" Kicad_REPO_LAST_CHANGED_AUTHOR "${_git_LAST_COMITTER}")
string( REGEX REPLACE "^(.*\n)?timestamp: [a-zA-Z]+ ([^ \n]+).*"
@ -118,13 +98,7 @@ macro( create_git_version_header _git_src_path )
if( Kicad_REPO_LAST_CHANGED_DATE )
string( REGEX REPLACE "^([0-9]+)\\-([0-9]+)\\-([0-9]+)" "\\1-\\2-\\3"
_kicad_git_date ${Kicad_REPO_LAST_CHANGED_DATE} )
if( ${_git_SHORT_HASH_LOCAL} EQUAL ${_git_SHORT_HASH_ORIGIN} )
set( KICAD_BUILD_VERSION "(${_kicad_git_date} ${Kicad_REPO_REVISION})" )
else()
message(STATUS "Your local git repo is different from the origin")
set( KICAD_BUILD_VERSION "(${_kicad_git_date} ${Kicad_REPO_REVISION}-${_git_SHORT_HASH_LOCAL})" )
endif()
set( KICAD_BUILD_VERSION "(${_kicad_git_date} ${Kicad_REPO_REVISION})" )
endif()
set( KICAD_BUILD_VERSION ${KICAD_BUILD_VERSION} )