Browse Source

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>
pull/646/head
Emily Mabrey 4 months ago
parent
commit
b8896742f8
No known key found for this signature in database GPG Key ID: 6F4EF47256A1B7DC
  1. 18
      CMakeLists.txt

18
CMakeLists.txt

@ -68,19 +68,31 @@ set( TENACITY_MODLEVEL 0 ) # Additional version detail
set( GIT_DESCRIBE "unknown" )
if( GIT_FOUND )
# Attempt to first get "Tenacity-" tags
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}
OUTPUT_VARIABLE GIT_DESCRIBE
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
set( git_output ${GIT_DESCRIBE} )
# TODO: Remove this after first Tenacity release
string( REPLACE "Audacity-" "" git_output "${git_output}" )
string( REPLACE "DarkAudacity-" "" git_output "${git_output}" )
string( REGEX REPLACE "-.*" "" git_output "${git_output}" )
string( REPLACE "." ";" git_output "${git_output}" )

Loading…
Cancel
Save