mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-02 16:49:41 +02:00
Fix GIT_DESCRIBE
generation
Initially attempt to find tags excluding "Audacity-" and "DarkAudacity-" Allow graceful fallback case for "Audacity-" tags Add logic to remove "DarkAudacity-" tag prefix to match "Audacity-" tag behavior Signed-off-by: Emily Mabrey <emabrey@tenacityaudio.org>
This commit is contained in:
parent
e776c2f7e4
commit
b8896742f8
@ -68,19 +68,31 @@ set( TENACITY_MODLEVEL 0 ) # Additional version detail
|
|||||||
set( GIT_DESCRIBE "unknown" )
|
set( GIT_DESCRIBE "unknown" )
|
||||||
|
|
||||||
if( GIT_FOUND )
|
if( GIT_FOUND )
|
||||||
|
# Attempt to first get "Tenacity-" tags
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND ${GIT_EXECUTABLE} describe --tags --abbrev=7
|
COMMAND ${GIT_EXECUTABLE} describe --tags --abbrev=7 --exclude="Audacity-*" --exclude="DarkAudacity-*"
|
||||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||||
OUTPUT_VARIABLE GIT_DESCRIBE
|
OUTPUT_VARIABLE GIT_DESCRIBE
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET
|
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET
|
||||||
)
|
)
|
||||||
|
|
||||||
if( GIT_DESCRIBE )
|
if( DEFINED GIT_DESCRIBE AND GIT_DESCRIBE STREQUAL "" )
|
||||||
|
# Retry, this time accepting "Audacity-" tags
|
||||||
|
execute_process(
|
||||||
|
COMMAND ${GIT_EXECUTABLE} describe --tags --abbrev=7 --exclude="DarkAudacity-*"
|
||||||
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||||
|
OUTPUT_VARIABLE GIT_DESCRIBE
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if( DEFINED GIT_DESCRIBE AND NOT GIT_DESCRIBE STREQUAL "" )
|
||||||
|
|
||||||
# Copy to new variable for string manipulation
|
# Copy to new variable for string manipulation
|
||||||
set( git_output ${GIT_DESCRIBE} )
|
set( git_output ${GIT_DESCRIBE} )
|
||||||
|
|
||||||
# TODO: Remove this after first Tenacity release
|
|
||||||
string( REPLACE "Audacity-" "" git_output "${git_output}" )
|
string( REPLACE "Audacity-" "" git_output "${git_output}" )
|
||||||
|
string( REPLACE "DarkAudacity-" "" git_output "${git_output}" )
|
||||||
|
|
||||||
string( REGEX REPLACE "-.*" "" git_output "${git_output}" )
|
string( REGEX REPLACE "-.*" "" git_output "${git_output}" )
|
||||||
string( REPLACE "." ";" git_output "${git_output}" )
|
string( REPLACE "." ";" git_output "${git_output}" )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user