Check the process exit code rather than output variable for git header creation
This commit is contained in:
parent
39b9b3e570
commit
08452433e8
|
@ -38,8 +38,8 @@ macro( create_git_version_header _git_src_path )
|
||||||
${GIT_EXECUTABLE} describe --dirty
|
${GIT_EXECUTABLE} describe --dirty
|
||||||
WORKING_DIRECTORY ${_git_src_path}
|
WORKING_DIRECTORY ${_git_src_path}
|
||||||
OUTPUT_VARIABLE _git_DESCRIBE
|
OUTPUT_VARIABLE _git_DESCRIBE
|
||||||
ERROR_VARIABLE _git_log_error
|
ERROR_VARIABLE _git_describe_error
|
||||||
RESULT_VARIABLE _git_log_result
|
RESULT_VARIABLE _git_describe_result
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
|
||||||
execute_process(
|
execute_process(
|
||||||
|
@ -47,8 +47,8 @@ macro( create_git_version_header _git_src_path )
|
||||||
${GIT_EXECUTABLE} rev-list --count --first-parent HEAD
|
${GIT_EXECUTABLE} rev-list --count --first-parent HEAD
|
||||||
WORKING_DIRECTORY ${_git_src_path}
|
WORKING_DIRECTORY ${_git_src_path}
|
||||||
OUTPUT_VARIABLE _git_REV_COUNT
|
OUTPUT_VARIABLE _git_REV_COUNT
|
||||||
ERROR_VARIABLE _git_log_error
|
ERROR_VARIABLE _git_rev_count_error
|
||||||
RESULT_VARIABLE _git_log_result
|
RESULT_VARIABLE _git_rev_count_result
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
|
||||||
set( ENV{LC_ALL} ${_Git_SAVED_LC_ALL} )
|
set( ENV{LC_ALL} ${_Git_SAVED_LC_ALL} )
|
||||||
|
@ -56,11 +56,11 @@ macro( create_git_version_header _git_src_path )
|
||||||
|
|
||||||
# Check to make sure 'git' command did not fail. Otherwise fallback
|
# Check to make sure 'git' command did not fail. Otherwise fallback
|
||||||
# to KiCadVersion.cmake as the revision level.
|
# to KiCadVersion.cmake as the revision level.
|
||||||
if( _git_DESCRIBE )
|
if( _git_describe_result EQUAL 0 )
|
||||||
set( KICAD_VERSION "(${_git_DESCRIBE})" )
|
set( KICAD_VERSION "(${_git_DESCRIBE})" )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if( _git_REV_COUNT )
|
if( _git_rev_count_result EQUAL 0 )
|
||||||
set( KICAD_GIT_REV "${_git_REV_COUNT}" )
|
set( KICAD_GIT_REV "${_git_REV_COUNT}" )
|
||||||
|
|
||||||
# Sanity check
|
# Sanity check
|
||||||
|
|
Loading…
Reference in New Issue