mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[11184] Allow build mangos without git repo
* Avoid cmake call fail if git binary found but - no git repository in current dir - git repository exist but no tags in repository * Output commit hash instead most recent tag name. Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
d597ffe10e
commit
f5d69052e1
2 changed files with 7 additions and 2 deletions
|
|
@ -217,10 +217,15 @@ add_custom_target(uninstall
|
|||
# Find core revision
|
||||
if(GIT_EXECUTABLE)
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} describe
|
||||
COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||
OUTPUT_VARIABLE GIT_REVISION
|
||||
RESULT_VARIABLE GIT_RESULT
|
||||
ERROR_QUIET
|
||||
)
|
||||
if(GIT_RESULT)
|
||||
set(GIT_REVISION "Git repository not found")
|
||||
endif()
|
||||
else()
|
||||
set(GIT_REVISION "Git not found")
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "11183"
|
||||
#define REVISION_NR "11184"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue