1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-16 16:10:06 +02:00

Preset GIT info in case GIT isn't installed

This commit is contained in:
Leland Lucius 2020-03-03 17:15:02 -06:00
parent 6bb10d4c8f
commit 3d1abf3ddb

View File

@ -119,6 +119,9 @@ elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
endif() endif()
# Try to get the current commit information # Try to get the current commit information
set( GIT_COMMIT_SHORT "unknown" )
set( GIT_COMMIT_LONG "unknown" )
set( GIT_COMMIT_TIME "unknown" )
find_package( Git QUIET ) find_package( Git QUIET )
if( GIT_FOUND ) if( GIT_FOUND )
execute_process( execute_process(
@ -131,18 +134,15 @@ if( GIT_FOUND )
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET ERROR_QUIET
) )
if ( git_output )
if( git_output )
list( GET git_output 0 GIT_COMMIT_SHORT ) list( GET git_output 0 GIT_COMMIT_SHORT )
list( GET git_output 1 GIT_COMMIT_LONG ) list( GET git_output 1 GIT_COMMIT_LONG )
list( GET git_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() endif()
message( STATUS " Current Commit: ${GIT_COMMIT_SHORT}" )
message( STATUS )
endif() endif()
message( STATUS " Current Commit: ${GIT_COMMIT_SHORT}" )
message( STATUS )
# Define option() prefix # Define option() prefix
set( _OPT "audacity_" ) set( _OPT "audacity_" )