Build version from current tag

This commit is contained in:
Axel Isouard 2017-03-27 19:59:16 +02:00
parent 5cda935434
commit 1bed0a6818
No known key found for this signature in database
GPG key ID: 4E64BB3EAAF31C29

View file

@ -1,10 +1,23 @@
set(LIBWEBRTC_MAJOR_VERSION 0) include(LibWebRTCExecute)
set(LIBWEBRTC_MINOR_VERSION 0)
set(LIBWEBRTC_PATCH_VERSION 1) libwebrtc_execute(
set(LIBWEBRTC_BUILD_VERSION -rc.4) COMMAND ${GIT_EXECUTABLE} describe --tags --dirty=-dirty
set(LIBWEBRTC_WEBRTC_HEAD refs/branch-heads/57) OUTPUT_VARIABLE _LIBWEBRTC_TAG
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
STAMPFILE webrtc-current-tag
STATUS "Retrieving current git tag"
ERROR "Unable to retrieve the current git tag"
)
string(STRIP ${_LIBWEBRTC_TAG} _LIBWEBRTC_TAG)
string(REGEX REPLACE "^v?([0-9]+)\\..*" "\\1" LIBWEBRTC_MAJOR_VERSION "${_LIBWEBRTC_TAG}")
string(REGEX REPLACE "^v?[0-9]+\\.([0-9]+).*" "\\1" LIBWEBRTC_MINOR_VERSION "${_LIBWEBRTC_TAG}")
string(REGEX REPLACE "^v?[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" LIBWEBRTC_PATCH_VERSION "${_LIBWEBRTC_TAG}")
string(REGEX REPLACE "^v?[0-9]+\\.[0-9]+\\.[0-9]+(.*)" "\\1" LIBWEBRTC_BUILD_VERSION "${_LIBWEBRTC_TAG}")
set(LIBWEBRTC_API_VERSION set(LIBWEBRTC_API_VERSION
"${LIBWEBRTC_MAJOR_VERSION}.${LIBWEBRTC_MINOR_VERSION}.${LIBWEBRTC_PATCH_VERSION}") "${LIBWEBRTC_MAJOR_VERSION}.${LIBWEBRTC_MINOR_VERSION}.${LIBWEBRTC_PATCH_VERSION}")
set(LIBWEBRTC_VERSION set(LIBWEBRTC_VERSION
${LIBWEBRTC_API_VERSION}${LIBWEBRTC_BUILD_VERSION}) ${LIBWEBRTC_API_VERSION}${LIBWEBRTC_BUILD_VERSION})
set(LIBWEBRTC_WEBRTC_HEAD refs/branch-heads/57)