diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,9 @@ ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE ) + IF(HG_REVISION STREQUAL "") + SET(HG_REVISION "hg-tip") + ENDIF() SET(LEMON_VERSION ${HG_REVISION} CACHE STRING "LEMON version string.") ENDIF() diff --git a/configure.ac b/configure.ac --- a/configure.ac +++ b/configure.ac @@ -2,14 +2,17 @@ dnl Version information. m4_define([lemon_version_number], - [m4_normalize(esyscmd([echo ${LEMON_VERSION}]))]) + [m4_normalize(esyscmd([echo ${LEMON_VERSION}]))]) dnl m4_define([lemon_version_number], []) m4_define([lemon_hg_path], [m4_normalize(esyscmd([./scripts/chg-len.py]))]) -m4_define([lemon_hg_revision], [m4_normalize(esyscmd([hg id -i]))]) +m4_define([lemon_hg_revision], [m4_normalize(esyscmd([hg id -i 2> /dev/null]))]) m4_define([lemon_version], [ifelse(lemon_version_number(), - [], - [lemon_hg_path().lemon_hg_revision()], - [lemon_version_number()])]) + [], + [ifelse(lemon_hg_revision(), + [], + [hg-tip], + [lemon_hg_path().lemon_hg_revision()])], + [lemon_version_number()])]) AC_PREREQ([2.59]) AC_INIT([LEMON], [lemon_version()], [lemon-user@lemon.cs.elte.hu], [lemon])