mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-25 06:25:56 +03:00
Correctly handle possible missing GIT_SHA1. (#5401)
Currently, if get_git_head_revision() doesn't define GIT_SHA1 (which it doesn't in some cases) it's possible to end up with the following error: CMake Error at CMakeLists.txt:69 (if): if given arguments: "STREQUAL" "GITDIR-NOTFOUND" Unknown arguments specified Fix this by making sure both left and right hand arguments to STREQUAL are always strings, even if GIT_SHA1 is undefined. Signed-off-by: Kyle Fazzari <kyle@canonical.com>
This commit is contained in:
parent
030e3a5d4a
commit
d1237cdda3
1 changed files with 1 additions and 1 deletions
|
@ -69,7 +69,7 @@ get_git_head_revision(GIT_REFSPEC GIT_SHA1)
|
|||
# if we cannot get it from git, directly try .tag (packages)
|
||||
# this will work if the tar balls have been properly created
|
||||
# via git-archive.
|
||||
if (${GIT_SHA1} STREQUAL "GITDIR-NOTFOUND")
|
||||
if ("${GIT_SHA1}" STREQUAL "GITDIR-NOTFOUND")
|
||||
file(READ ${CMAKE_SOURCE_DIR}/.tag sha1_candidate)
|
||||
string(REPLACE "\n" "" sha1_candidate ${sha1_candidate})
|
||||
if (NOT ${sha1_candidate} STREQUAL "$Format:%H$")
|
||||
|
|
Loading…
Reference in a new issue