Commit 1f37c26d authored by Jaikrishnan Menon's avatar Jaikrishnan Menon Committed by Robert Kimball

CMake: Fix broken revision parsing code (#963)

parent af946b7d
...@@ -19,7 +19,9 @@ function(NGRAPH_GET_CURRENT_HASH) ...@@ -19,7 +19,9 @@ function(NGRAPH_GET_CURRENT_HASH)
execute_process( execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --verify HEAD COMMAND ${GIT_EXECUTABLE} rev-parse --verify HEAD
RESULT_VARIABLE result RESULT_VARIABLE result
OUTPUT_VARIABLE HASH) OUTPUT_VARIABLE HASH
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
string(STRIP ${HASH} HASH) string(STRIP ${HASH} HASH)
set(NGRAPH_CURRENT_HASH ${HASH} PARENT_SCOPE) set(NGRAPH_CURRENT_HASH ${HASH} PARENT_SCOPE)
endfunction() endfunction()
...@@ -29,7 +31,9 @@ function(NGRAPH_GET_TAG_OF_CURRENT_HASH) ...@@ -29,7 +31,9 @@ function(NGRAPH_GET_TAG_OF_CURRENT_HASH)
execute_process( execute_process(
COMMAND ${GIT_EXECUTABLE} ls-remote --tags COMMAND ${GIT_EXECUTABLE} ls-remote --tags
RESULT_VARIABLE RESULT RESULT_VARIABLE RESULT
OUTPUT_VARIABLE TAG_LIST) OUTPUT_VARIABLE TAG_LIST
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
NGRAPH_GET_CURRENT_HASH() NGRAPH_GET_CURRENT_HASH()
string(REGEX MATCH "${NGRAPH_CURRENT_HASH}\t[^\r\n]*" TAG ${TAG_LIST}) string(REGEX MATCH "${NGRAPH_CURRENT_HASH}\t[^\r\n]*" TAG ${TAG_LIST})
...@@ -45,7 +49,9 @@ function(NGRAPH_GET_MOST_RECENT_TAG) ...@@ -45,7 +49,9 @@ function(NGRAPH_GET_MOST_RECENT_TAG)
execute_process( execute_process(
COMMAND ${GIT_EXECUTABLE} describe --tags --abbrev=0 COMMAND ${GIT_EXECUTABLE} describe --tags --abbrev=0
RESULT_VARIABLE RESULT RESULT_VARIABLE RESULT
OUTPUT_VARIABLE TAG) OUTPUT_VARIABLE TAG
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
string(STRIP ${TAG} TAG) string(STRIP ${TAG} TAG)
set(NGRAPH_MOST_RECENT_RELEASE_TAG ${TAG} PARENT_SCOPE) set(NGRAPH_MOST_RECENT_RELEASE_TAG ${TAG} PARENT_SCOPE)
endfunction() endfunction()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment