diff --git a/CMakeLists.txt b/CMakeLists.txt index 2dd00bb4a..6e663b53e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -119,6 +119,9 @@ elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) endif() # 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 ) if( GIT_FOUND ) execute_process( @@ -131,18 +134,15 @@ if( GIT_FOUND ) OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET ) - if ( git_output ) + + 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() +message( STATUS " Current Commit: ${GIT_COMMIT_SHORT}" ) +message( STATUS ) # Define option() prefix set( _OPT "audacity_" )