cmake: add basic git version stamp
This commit is contained in:
parent
cf90813f87
commit
5b52c148a6
|
@ -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 )
|
||||
|
|
Loading…
Reference in New Issue