diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,13 @@ SET(LEMON_VERSION $ENV{LEMON_VERSION} CACHE STRING "LEMON version string.") ELSE() EXECUTE_PROCESS( + COMMAND ./scripts/chg-len.py + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + OUTPUT_VARIABLE HG_REVISION_PATH + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + EXECUTE_PROCESS( COMMAND hg id -i WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE HG_REVISION @@ -16,9 +23,11 @@ OUTPUT_STRIP_TRAILING_WHITESPACE ) IF(HG_REVISION STREQUAL "") - SET(HG_REVISION "hg-tip") + SET(HG_REVISION_ID "hg-tip") + ELSE() + SET(HG_REVISION_ID ${HG_REVISION_PATH}.${HG_REVISION}) ENDIF() - SET(LEMON_VERSION ${HG_REVISION} CACHE STRING "LEMON version string.") + SET(LEMON_VERSION ${HG_REVISION_ID} CACHE STRING "LEMON version string.") ENDIF() SET(PROJECT_VERSION ${LEMON_VERSION})