cmake: add basic git version stamp

This commit is contained in:
Michael Gehring 2008-06-17 16:41:49 +02:00 committed by Julien Danjou
parent cf90813f87
commit 5b52c148a6
1 changed files with 13 additions and 0 deletions

View File

@ -6,6 +6,19 @@ PROJECT( ${PROJECT_AWE_NAME} )
SET( CMAKE_BUILD_TYPE RELEASE )
# If this is a git repository...
IF( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git/HEAD )
# ...update version
FIND_PROGRAM(GIT_EXECUTABLE git)
IF( GIT_EXECUTABLE )
EXECUTE_PROCESS( COMMAND ${GIT_EXECUTABLE} describe
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE )
ENDIF( GIT_EXECUTABLE )
ENDIF( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git/HEAD )
# Check for doxygen
INCLUDE( FindDoxygen )
INCLUDE( FindPkgConfig )