Fix version auto generation.

This commit is contained in:
Jan Vidar Krey 2012-10-02 23:01:57 +02:00
parent 25c82076da
commit a90807fccb
2 changed files with 2 additions and 3 deletions

View File

@ -141,10 +141,11 @@ if(UNIX)
target_link_libraries(uhub-admin adcclient adc network utils)
endif()
if(GIT_FOUND)
if(GIT_FOUND AND IS_DIRECTORY ".git")
execute_process(COMMAND ${GIT_EXECUTABLE} show -s --pretty=format:%h OUTPUT_VARIABLE UHUB_REVISION)
set (UHUB_GIT_VERSION "${UHUB_VERSION_MAJOR}.${UHUB_VERSION_MINOR}.${UHUB_VERSION_PATCH}-git-${UHUB_REVISION}")
else()
set (UHUB_GIT_VERSION "${UHUB_VERSION_MAJOR}.${UHUB_VERSION_MINOR}.${UHUB_VERSION_PATCH}-release")
endif()
if(OPENSSL_FOUND)

View File

@ -23,14 +23,12 @@
#define VERSION "@UHUB_VERSION_MAJOR@.@UHUB_VERSION_MINOR@.@UHUB_VERSION_PATCH@"
#endif
#define GIT_REVISION "@UHUB_REVISION@"
#define GIT_VERSION "@UHUB_GIT_VERSION@"
#ifndef PRODUCT
#define PRODUCT "uhub"
#endif
#define REVISION GIT_REVISION
#define PRODUCT_STRING PRODUCT "/" GIT_VERSION
#ifndef COPYRIGHT