diff --git a/cmake/version.inc b/cmake/version.inc old mode 100644 new mode 100755 index 0509a5ce1b2d44f4986c734060853b3aa32addac..f9927bf1c61c62dd27123e1c6aec158c4d1c09cf --- a/cmake/version.inc +++ b/cmake/version.inc @@ -16,13 +16,25 @@ ENDIF () IF (DEFINED GITINFO) SET(TD_VER_GIT ${GITINFO}) ELSE () - SET(TD_VER_GIT "community") + execute_process( + COMMAND git log -1 --format=%H + WORKING_DIRECTORY ${TD_COMMUNITY_DIR} + OUTPUT_VARIABLE GIT_COMMITID + ) + string (REGEX REPLACE "[\n\t\r]" "" GIT_COMMITID ${GIT_COMMITID}) + SET(TD_VER_GIT ${GIT_COMMITID}) ENDIF () IF (DEFINED GITINFOI) SET(TD_VER_GIT_INTERNAL ${GITINFOI}) ELSE () - SET(TD_VER_GIT_INTERNAL "internal") + execute_process( + COMMAND git log -1 --format=%H + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + OUTPUT_VARIABLE GIT_COMMITID + ) + string (REGEX REPLACE "[\n\t\r]" "" GIT_COMMITID ${GIT_COMMITID}) + SET(TD_VER_GIT_INTERNAL ${GIT_COMMITID}) ENDIF () IF (DEFINED VERDATE)