1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-04 16:14:00 +01:00

[CMAKE] Fix build outside of git repository (#440)

This commit is contained in:
Raphael Graf
2020-03-04 00:11:22 +01:00
committed by GitHub
parent 3d38ddf6a2
commit 6bb10d4c8f

View File

@@ -127,14 +127,19 @@ if( GIT_FOUND )
WORKING_DIRECTORY
${topdir}
OUTPUT_VARIABLE
output
git_output
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
)
list( GET output 0 GIT_COMMIT_SHORT )
list( GET output 1 GIT_COMMIT_LONG )
list( GET output 2 GIT_COMMIT_TIME )
if ( git_output )
list( GET git_output 0 GIT_COMMIT_SHORT )
list( GET git_output 1 GIT_COMMIT_LONG )
list( GET git_output 2 GIT_COMMIT_TIME )
else()
set( GIT_COMMIT_SHORT "unknown" )
set( GIT_COMMIT_LONG "unknown" )
set( GIT_COMMIT_TIME "unknown" )
endif()
message( STATUS " Current Commit: ${GIT_COMMIT_SHORT}" )
message( STATUS )
endif()