[x265] [PATCH] cmake: fix X265_VERSION not defined problem

chen chenm003 at 163.com
Sun Oct 6 07:55:18 CEST 2013


I think we need to modify logic in hg path, because HG_REVISION will write empty string to X265_VERSION in this path
 
在 2013-10-06 12:06:24,"Steve Borho" <steve at borho.org> 写道:



On Sat, Oct 5, 2013 at 9:26 PM, Min Chen <chenm003 at 163.com> wrote:
# HG changeset patch
# User Min Chen <chenm003 at 163.com>
# Date 1381026364 -28800
# Node ID 82d688c22244139df4fc986df60196c1e9541b3d
# Parent  4ee217cd64cc18a1f62fb8ef75c46240c123d1d9
cmake: fix X265_VERSION not defined problem

Some system install hg but the source tree isn't managed by HG,
In this time, we will build fail with error X265_VERSION macro

diff -r 4ee217cd64cc -r 82d688c22244 source/cmake/version.cmake
--- a/source/cmake/version.cmake        Fri Oct 04 15:30:31 2013 -0500
+++ b/source/cmake/version.cmake        Sun Oct 06 10:26:04 2013 +0800
@@ -28,7 +28,7 @@
     endif()
 elseif(DEFINED ENV{X265_VERSION})
     set(X265_VERSION $ENV{X265_REVISION})
-elseif(HG_EXECUTABLE)
+elseif(HG_EXECUTABLE AND EXISTS ${CMAKE_SOURCE_DIR}/.hg)



I see the problem you're trying to solve but this probably isn't the best solution.


Can we just give X265_VERSION a value "unknown" at the top of the file in case the later checks all fail?
 
     execute_process(COMMAND
         ${HG_EXECUTABLE} log -r. --template "{latesttag}"
         WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}



--
Steve Borho 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20131006/d864644b/attachment.html>


More information about the x265-devel mailing list