Skip to content

Commit b1066c5

Browse files
committed
be robust for non-alphanum chars in branch name
1 parent 6ab7154 commit b1066c5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cmake/version.cmake

+4-1
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,11 @@ function(version_extract)
152152

153153
set(GIT_VERSION "${_GIT_VERSION}${version_git_dirty}")
154154
else()
155+
string(REGEX REPLACE "[^A-Za-z0-9]+" "+" _version_git_branch
156+
"${version_git_branch}"
157+
)
155158
set(GIT_VERSION
156-
"${version_git_head}+${version_git_branch}${version_build}${version_git_dirty}"
159+
"${version_git_head}+${_version_git_branch}${version_build}${version_git_dirty}"
157160
)
158161
endif()
159162

0 commit comments

Comments
 (0)