[x265] [PATCH 2/2] Set version and latest tag if using a git repository
Steve Borho
steve at borho.org
Thu Dec 19 00:58:08 CET 2013
Thanks funman, I've queued all three
On Dec 18, 2013, at 4:28 AM, Rafaël Carré <funman at videolan.org> wrote:
> ---
> source/cmake/version.cmake | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/source/cmake/version.cmake b/source/cmake/version.cmake
> index 0d2346f..5aa5935 100644
> --- a/source/cmake/version.cmake
> +++ b/source/cmake/version.cmake
> @@ -1,4 +1,5 @@
> find_program(HG_EXECUTABLE hg)
> +find_program(GIT_EXECUTABLE git)
>
> if(EXISTS ${CMAKE_SOURCE_DIR}/../.hg_archival.txt)
> # read the lines of the archive summary file to extract the version
> @@ -71,6 +72,24 @@ elseif(HG_EXECUTABLE AND EXISTS ${CMAKE_SOURCE_DIR}/../.hg)
> endif()
>
> set(X265_VERSION ${HG_REVISION})
> +elseif(GIT_EXECUTABLE AND EXISTS ${CMAKE_SOURCE_DIR}/../.git)
> + execute_process(
> + COMMAND
> + ${GIT_EXECUTABLE} describe --tags --abbrev=0
> + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
> + OUTPUT_VARIABLE X265_LATEST_TAG
> + ERROR_QUIET
> + OUTPUT_STRIP_TRAILING_WHITESPACE
> + )
> +
> + execute_process(
> + COMMAND
> + ${GIT_EXECUTABLE} describe --tags
> + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
> + OUTPUT_VARIABLE X265_VERSION
> + ERROR_QUIET
> + OUTPUT_STRIP_TRAILING_WHITESPACE
> + )
> else()
> set(X265_VERSION "unknown")
> endif()
> --
> 1.8.5.2
>
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20131218/1e4b5afd/attachment.sig>
More information about the x265-devel
mailing list