diff options
author | Riccardo Spagni <ric@spagni.net> | 2014-09-15 20:17:23 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2014-09-15 20:18:40 +0200 |
commit | f3271e8f1203c86d5bdfbcb0b210296a26be95bf (patch) | |
tree | 6610e02fee06c827d275a825c2ec58ad7aa48e16 | |
parent | Merge pull request #140 (diff) | |
parent | fix CMake for multiplatform versioning (diff) | |
download | monero-f3271e8f1203c86d5bdfbcb0b210296a26be95bf.tar.xz |
Merge pull request #141v0.8.8.4
b92a8b5 fix CMake for multiplatform versioning (Riccardo Spagni)
-rw-r--r-- | src/version.cmake | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/version.cmake b/src/version.cmake index c115b9d36..e851cdf01 100644 --- a/src/version.cmake +++ b/src/version.cmake @@ -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}") |