From 08452433e8e35a74c10afa886ea7585634ec1e2c Mon Sep 17 00:00:00 2001 From: Mark Roszko Date: Sat, 29 Oct 2022 18:39:02 +0000 Subject: [PATCH] Check the process exit code rather than output variable for git header creation --- CMakeModules/CreateGitVersionHeader.cmake | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeModules/CreateGitVersionHeader.cmake b/CMakeModules/CreateGitVersionHeader.cmake index 51b69eda56..2853fe149e 100644 --- a/CMakeModules/CreateGitVersionHeader.cmake +++ b/CMakeModules/CreateGitVersionHeader.cmake @@ -38,8 +38,8 @@ macro( create_git_version_header _git_src_path ) ${GIT_EXECUTABLE} describe --dirty WORKING_DIRECTORY ${_git_src_path} OUTPUT_VARIABLE _git_DESCRIBE - ERROR_VARIABLE _git_log_error - RESULT_VARIABLE _git_log_result + ERROR_VARIABLE _git_describe_error + RESULT_VARIABLE _git_describe_result OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process( @@ -47,8 +47,8 @@ macro( create_git_version_header _git_src_path ) ${GIT_EXECUTABLE} rev-list --count --first-parent HEAD WORKING_DIRECTORY ${_git_src_path} OUTPUT_VARIABLE _git_REV_COUNT - ERROR_VARIABLE _git_log_error - RESULT_VARIABLE _git_log_result + ERROR_VARIABLE _git_rev_count_error + RESULT_VARIABLE _git_rev_count_result OUTPUT_STRIP_TRAILING_WHITESPACE) 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 # to KiCadVersion.cmake as the revision level. - if( _git_DESCRIBE ) + if( _git_describe_result EQUAL 0 ) set( KICAD_VERSION "(${_git_DESCRIBE})" ) endif() - if( _git_REV_COUNT ) + if( _git_rev_count_result EQUAL 0 ) set( KICAD_GIT_REV "${_git_REV_COUNT}" ) # Sanity check