build(cmake): do not hard-code default branch name

This commit is contained in:
Oleg Shparber 2023-03-18 23:23:03 -04:00
parent 84f2608abc
commit 59d54d1bad

View File

@ -81,7 +81,7 @@ execute_process(COMMAND ${GIT_EXECUTABLE} describe --abbrev=0 --tags
OUTPUT_STRIP_TRAILING_WHITESPACE)
# How many commits since the last tag
execute_process(COMMAND ${GIT_EXECUTABLE} rev-list master ${${PROJECT_NAME}_GIT_VERSION_STRING}^..HEAD --count
execute_process(COMMAND ${GIT_EXECUTABLE} rev-list ${${PROJECT_NAME}_GIT_VERSION_STRING}^..HEAD --count
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE ${PROJECT_NAME}_GIT_VERSION_AHEAD
OUTPUT_STRIP_TRAILING_WHITESPACE)