Fix version auto generation.
This commit is contained in:
parent
25c82076da
commit
a90807fccb
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue