[x265] [PATCH 3 of 3] Make git X265_VERSION output the same as mercurial

chen chenm003 at 163.com
Tue Jun 14 18:47:32 CEST 2016


At 2016-05-31 21:17:26,"Ricardo Constantino" <wiiaboo at gmail.com> wrote:
># HG changeset patch
># User Ricardo Constantino <wiiaboo at gmail.com>
># Date 1464700015 -3600
>#      Tue May 31 14:06:55 2016 +0100
># Node ID b32b40d45adc80af6dd7b4024b59fc34cd64866e
># Parent  227fc2663961b470a250ca1cdcebf79a411e6d9d
>Make git X265_VERSION output the same as mercurial
>(except X265_REVISION_ID)
>
>diff -r 227fc2663961 -r b32b40d45adc source/cmake/version.cmake
>--- a/source/cmake/version.cmake	Tue May 31 14:06:50 2016 +0100
>+++ b/source/cmake/version.cmake	Tue May 31 14:06:55 2016 +0100
>@@ -54,20 +54,15 @@
>         COMMAND
>         ${HG_EXECUTABLE} log -r. --template "{node}"
>         WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
>-        OUTPUT_VARIABLE HG_REVISION_ID
>+        OUTPUT_VARIABLE X265_REVISION_ID
>         ERROR_QUIET
>         OUTPUT_STRIP_TRAILING_WHITESPACE
>         )
>-    string(SUBSTRING "${HG_REVISION_ID}" 0 16 HG_REVISION_ID)
>+    string(SUBSTRING "${X265_REVISION_ID}" 0 16 X265_REVISION_ID)
> 
>     if(X265_LATEST_TAG MATCHES "^r")
>         string(SUBSTRING ${X265_LATEST_TAG} 1 -1 X265_LATEST_TAG)
>     endif()
>-    if(X265_TAG_DISTANCE STREQUAL "0")
>-        set(X265_VERSION "${X265_LATEST_TAG}")
>-    else()
>-        set(X265_VERSION "${X265_LATEST_TAG}+${X265_TAG_DISTANCE}-${HG_REVISION_ID}")
>-    endif()
> elseif(GIT_EXECUTABLE AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../.git)
>     execute_process(
>         COMMAND
>@@ -77,15 +72,27 @@
>         ERROR_QUIET
>         OUTPUT_STRIP_TRAILING_WHITESPACE
>         )
>-
>     execute_process(
>         COMMAND
>-        ${GIT_EXECUTABLE} describe --tags --first-parent
>+        ${GIT_EXECUTABLE} rev-list ${X265_LATEST_TAG}.. --count --first-parent
My Git 1.7.9 can't support "--first-parent", so the X265_LATEST_TAG will be empty, it made the cmake build failed.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20160615/62b66216/attachment.html>


More information about the x265-devel mailing list