diff options
author | Riccardo Spagni <ric@spagni.net> | 2014-09-15 23:07:47 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2014-09-15 23:07:47 +0200 |
commit | ffe7bf8c1cd373b4cd2d256a5f4ea5359a0a35c0 (patch) | |
tree | 6155cbd690fe20fbb2c87dca7d0df2d955d180cb | |
parent | Prevent CMake choking on empty vars (diff) | |
download | monero-ffe7bf8c1cd373b4cd2d256a5f4ea5359a0a35c0.tar.xz |
another fix for CMake empty vars
Diffstat (limited to '')
-rw-r--r-- | src/version.cmake | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/version.cmake b/src/version.cmake index 02f5ec0a6..2f3aa0b25 100644 --- a/src/version.cmake +++ b/src/version.cmake @@ -40,13 +40,15 @@ if(RET) else() message(STATUS "You are currently on commit ${COMMIT}") - # Give our output variable a default value, because CMake likes to choke on empty variables - set(TAGGEDCOMMITOUT "a") # Get all the tags execute_process(COMMAND "${GIT}" show-ref --tags -d --abbrev RESULT_VARIABLE RET OUTPUT_VARIABLE TAGGEDCOMMITOUT OUTPUT_STRIP_TRAILING_WHITESPACE) # Make sure we actually got some tags - string(LENGTH ${TAGGEDCOMMITOUT} TLEN) + if(TAGGEDCOMMITOUT) + string(LENGTH ${TAGGEDCOMMITOUT} TLEN) + else() + set(TLEN 1) + endif() if(RET OR TLEN LESS 5) message(WARNING "Cannot determine most recent tag. Make sure that you are building either from a Git working tree or from a source archive.") |