mirror of
https://github.com/monero-project/monero.git
synced 2024-11-18 00:37:43 +00:00
fix CMake for multiplatform versioning
This commit is contained in:
parent
0214524166
commit
b92a8b53e0
1 changed files with 6 additions and 1 deletions
|
@ -6,7 +6,12 @@ if(RET)
|
|||
configure_file("src/version.h.in" "${TO}")
|
||||
else()
|
||||
message(STATUS "You are currently on commit ${COMMIT}")
|
||||
execute_process(COMMAND "${GIT}" show-ref --tags -d --abbrev COMMAND awk "END{print $1}" RESULT_VARIABLE RET OUTPUT_VARIABLE TAGGEDCOMMIT OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
execute_process(COMMAND "${GIT}" show-ref --tags -d --abbrev RESULT_VARIABLE RET OUTPUT_VARIABLE TAGGEDCOMMITOUT OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
string(REPLACE " refs/" "\n" TAGGEDCOMMITOUT2 ${TAGGEDCOMMITOUT})
|
||||
string(REPLACE "\n" ";" TAGGEDCOMMITLIST ${TAGGEDCOMMITOUT2})
|
||||
list(GET TAGGEDCOMMITLIST -2 TAGGEDCOMMIT)
|
||||
|
||||
if(RET OR NOT TAGGEDCOMMIT)
|
||||
message(WARNING "Cannot determine most recent tag. Make sure that you are building either from a Git working tree or from a source archive.")
|
||||
set(VERSIONTAG "${COMMIT}")
|
||||
|
|
Loading…
Reference in a new issue