+function(_increment_patch_and_strip_package_release _VERSION_PATCH _VERSION_EXTRA)
+ string(REGEX REPLACE "^[0-9a-zA-Z]+\\.(r[0-9]+\\.g[0-9a-zA-Z]+)$" "\\1"
+ _VERSION_EXTRA "${_VERSION_EXTRA}")
+
+ MATH(EXPR _VERSION_PATCH "${_VERSION_PATCH}+1")
+
+ set(VERSION_PATCH "${_VERSION_PATCH}" PARENT_SCOPE)
+ set(VERSION_EXTRA "${_VERSION_EXTRA}" PARENT_SCOPE)
+endfunction()
+
+function(_set_untagged_commit_flag _VERSION_EXTRA)
+ if("${_VERSION_EXTRA}" MATCHES "^[0-9a-zA-Z]+.r[0-9]+\\.g[0-9a-zA-Z]+$")
+ set(IS_UNTAGGED_COMMIT TRUE PARENT_SCOPE)
+ _increment_patch_and_strip_package_release(${VERSION_PATCH} ${VERSION_EXTRA})
+ endif()
+endfunction()
+