Correctly handle possible missing GIT_SHA1. (#5401)
authorKyle Fazzari <kyrofa@users.noreply.github.com>
Wed, 21 Dec 2016 13:14:26 +0000 (05:14 -0800)
committerMarkus Goetz <markus@woboq.com>
Wed, 21 Dec 2016 13:14:26 +0000 (14:14 +0100)
commitd1237cdda330f64ec56993893cc92bf7c1508953
treef35a7f118e7f21432a08b8e2909ea006340f9287
parent030e3a5d4ab4b2f7173cbddf2e6b23e92053c3bb
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>
CMakeLists.txt