# HG changeset patch # User Akos Ladanyi # Date 2010-08-25 22:02:40 # Node ID e74b5db4f2c65b830730864ea94f956100f39e0a # Parent e20fecd1945f0d5ac2a82b79a0e7d794de4e6cd9 Put the output of chg-len.py in the version string (#389) 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})