<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Oct 5, 2013 at 9:26 PM, Min Chen <span dir="ltr"><<a href="mailto:chenm003@163.com" target="_blank">chenm003@163.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"># HG changeset patch<br>
# User Min Chen <<a href="mailto:chenm003@163.com">chenm003@163.com</a>><br>
# Date 1381026364 -28800<br>
# Node ID 82d688c22244139df4fc986df60196c1e9541b3d<br>
# Parent 4ee217cd64cc18a1f62fb8ef75c46240c123d1d9<br>
cmake: fix X265_VERSION not defined problem<br>
<br>
Some system install hg but the source tree isn't managed by HG,<br>
In this time, we will build fail with error X265_VERSION macro<br>
<br>
diff -r 4ee217cd64cc -r 82d688c22244 source/cmake/version.cmake<br>
--- a/source/cmake/version.cmake Fri Oct 04 15:30:31 2013 -0500<br>
+++ b/source/cmake/version.cmake Sun Oct 06 10:26:04 2013 +0800<br>
@@ -28,7 +28,7 @@<br>
endif()<br>
elseif(DEFINED ENV{X265_VERSION})<br>
set(X265_VERSION $ENV{X265_REVISION})<br>
-elseif(HG_EXECUTABLE)<br>
+elseif(HG_EXECUTABLE AND EXISTS ${CMAKE_SOURCE_DIR}/.hg)<br></blockquote><div><br></div><div>I see the problem you're trying to solve but this probably isn't the best solution.</div><div><br></div><div>Can we just give X265_VERSION a value "unknown" at the top of the file in case the later checks all fail?</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
execute_process(COMMAND<br>
${HG_EXECUTABLE} log -r. --template "{latesttag}"<br>
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}<br></blockquote><div><br></div><div>--</div><div>Steve Borho </div></div></div></div>