From 757609a84e33fe0d7aed3261509e5c38154afcc2 Mon Sep 17 00:00:00 2001 From: Maksim Andrianov Date: Tue, 27 Aug 2019 14:10:12 +0300 Subject: [PATCH] Review fixes --- cmake/BuildVersion.cmake | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/cmake/BuildVersion.cmake b/cmake/BuildVersion.cmake index ef89d2120b..cdfa5207f6 100644 --- a/cmake/BuildVersion.cmake +++ b/cmake/BuildVersion.cmake @@ -6,10 +6,10 @@ function(get_last_git_commit_hash result_name) RESULT_VARIABLE status ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) - if (NOT status STREQUAL "0") - message(WARNING "Failed to get hash for last commit from git.") - else() + if (status STREQUAL "0") set(${result_name} ${GIT_HASH} PARENT_SCOPE) + else() + message(WARNING "Failed to get hash for last commit from git.") endif() endfunction() @@ -21,25 +21,25 @@ function(get_last_git_commit_timestamp result_name) RESULT_VARIABLE status ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) - if (NOT status STREQUAL "0") - message(WARNING "Failed to get timestamp for last commit from git.") - else() + if (status STREQUAL "0") set(${result_name} ${GIT_TIMESTAMP} PARENT_SCOPE) + else() + message(WARNING "Failed to get timestamp for last commit from git.") endif() endfunction() function(get_git_tag_name result_name) execute_process(COMMAND - "${GIT_EXECUTABLE}" git tag --points-at HEAD + "${GIT_EXECUTABLE}" tag --points-at HEAD WORKING_DIRECTORY "${MAPSME_CURRENT_PROJECT_ROOT}" OUTPUT_VARIABLE GIT_TAG RESULT_VARIABLE status ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) - if (NOT status STREQUAL "0") - message(WARNING "Failed to get tag for last commit from git.") - else() + if (status STREQUAL "0") set(${result_name} ${GIT_TAG} PARENT_SCOPE) + else() + message(WARNING "Failed to get tag for last commit from git.") endif() endfunction()