mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-18 00:50:05 +02:00
[CMAKE] Fix build outside of git repository (#440)
This commit is contained in:
parent
3d38ddf6a2
commit
6bb10d4c8f
@ -127,14 +127,19 @@ if( GIT_FOUND )
|
|||||||
WORKING_DIRECTORY
|
WORKING_DIRECTORY
|
||||||
${topdir}
|
${topdir}
|
||||||
OUTPUT_VARIABLE
|
OUTPUT_VARIABLE
|
||||||
output
|
git_output
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
ERROR_QUIET
|
||||||
)
|
)
|
||||||
|
if ( git_output )
|
||||||
list( GET output 0 GIT_COMMIT_SHORT )
|
list( GET git_output 0 GIT_COMMIT_SHORT )
|
||||||
list( GET output 1 GIT_COMMIT_LONG )
|
list( GET git_output 1 GIT_COMMIT_LONG )
|
||||||
list( GET output 2 GIT_COMMIT_TIME )
|
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 " Current Commit: ${GIT_COMMIT_SHORT}" )
|
||||||
message( STATUS )
|
message( STATUS )
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user