Skip to content

Commit 2f148df

Browse files
committed
Add more robust extraction of git-describe
1 parent e1be28b commit 2f148df

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,14 @@ if((NOT (OpenCoarraysVersion MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")) AND (EXISTS "$
3939
OUTPUT_STRIP_TRAILING_WHITESPACE)
4040
if((git_status STREQUAL "0") AND (git_output MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+"))
4141
set(OpenCoarraysVersion "${git_output}")
42-
execute_process(COMMAND "${GIT_EXECUTABLE}" describe --always --dirty
42+
endif()
43+
execute_process(COMMAND "${GIT_EXECUTABLE}" describe --always --dirty
4344
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
4445
RESULT_VARIABLE git_status
4546
OUTPUT_VARIABLE full_git_describe
4647
OUTPUT_STRIP_TRAILING_WHITESPACE)
48+
if(NOT (git_status STREQUAL "0"))
49+
set(full_git_describe NOTFOUND)
4750
endif()
4851
else()
4952
message( WARNING "Could not find git executable!")

0 commit comments

Comments
 (0)