using mercurial instead of TortoiseHg
Hello everybody, I hope this is the right place for that question. In the past I use TortoiseHg to clone the repo from x265 and that works fine. But now I will change to the internal mercurial from msys2. I can clone with them and pull/update but when I try to configure with cmake it stops with errors, because it doesn't get the version information. On the place where normally the version stays it is this:
x265 version +-
Is there a way to fix that?
Regards! jb_
Comments (8)
-
Account Deleted -
reporter Hi den c, thank you for that tip! It is a good idea to do it in that way. But how you now then witch Version you have?
-
Account Deleted It is a good idea to do it in that way.
Its quick'n'dirty workaround. We should get how to fix this. I suppose ERROR_QUIET in ../cmake/version.cmake should be replaced to ERROR_FILE version_errors.log and after that look what printed there.
And second hint, which helps me. Since mercurial on windows has .bat extension Put this somewhere into cmake/version.cmake:
set(HG_EXECUTABLE "${HG_EXECUTABLE}.bat")
-
Account Deleted Here patch
--- a/source/cmake/version.cmake Tue May 20 15:00:21 2014 -0500 +++ b/source/cmake/version.cmake Wed May 21 01:59:00 2014 +0300 @@ -30,6 +30,12 @@ set(X265_VERSION "${hg_latesttag}+${hg_latesttagdistance}-${hg_id}") endif() elseif(HG_EXECUTABLE AND EXISTS ${CMAKE_SOURCE_DIR}/../.hg) + #windows check + if(EXISTS "${HG_EXECUTABLE}.bat") + set(HG_EXECUTABLE "${HG_EXECUTABLE}.bat") + endif() + message(STATUS "hg found at ${HG_EXECUTABLE}") + execute_process(COMMAND ${HG_EXECUTABLE} log -r. --template "{latesttag}" WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
-
- changed status to resolved
cmake: detect mercurial source installs on Windows, fixes
#56→ <<cset a1c87ac44989>>
-
reporter Ah, the new layout from bitkucket makes me confuse. I had write yesterday on the wrong wall. By me this patch doesn't work because inside of msys2 hg works over a python script(without extension), and this I can not use directly over cmake. Even python /bin/hg will not work. so I found a work around like that:
Here is now my workaround, every time when the build gets update it makes this commands: sed -i '/set(X265_LATEST_TAG/d' source/cmake/version.cmake sed -i '/set(X265_TAG_DISTANCE/d' source/cmake/version.cmake sed -i '/set(HG_REVISION_ID/d' source/cmake/version.cmake cd .hg tag=`hg log -r. --template "{latesttag}"` distance=`hg log -r. --template "{latesttagdistance}"` node=`hg log -r. --template "{node|short}"` cd .. sed -i '/if(X265_LATEST_TAG MATCHES "^r")/i \ set(X265_LATEST_TAG '\"$tag\"') \ set(X265_TAG_DISTANCE '\"$distance\"') \ set(HG_REVISION_ID '\"$node\"')' source/cmake/version.cmake
-
reporter forget about this post. Maybe I edit it later again. I was not able to delete them.
-
reporter Ok now a different solution, without this bad sed. I wrote my own hg.bat file like that:
@echo off setlocal set HG=%~f0 set PYTHONHOME= set in=%* set out=%in: {= "{% set out=%out:} =}" % %~dp0python2 %~dp0hg %out%
Sadly the input lose by the first two inputs the quotation so I have to do a replacement.
- Log in to comment
I have similar trouble. Used dirty solution: just commented this lines in x265/source/CMakeLists.txt
And manually wrote versions in x265/build/msys/x265.rc