From a44c5851ccf942f41c5eb24feaebad44e5befb6d Mon Sep 17 00:00:00 2001 From: Brendan Le Foll Date: Tue, 16 Jun 2015 11:12:16 +0100 Subject: [PATCH] cmake: fix version when git is pesent but no tree is found This avoids the version being .so.HEAD-HASH-NOTFOUND or similar when git is present on the target but a valid tree is not found Signed-off-by: Brendan Le Foll --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 12cc0c2..ad0b3e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,7 @@ set (CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_ # Make a version file containing the current version from git. include (GetGitRevisionDescription) git_describe (VERSION "--tags") -if ("x_${VERSION}" STREQUAL "x_GIT-NOTFOUND") +if ("x_${VERSION}" STREQUAL "x_GIT-NOTFOUND" OR "x_${VERSION}" STREQUAL "x_HEAD-HASH-NOTFOUND") message (WARNING " - Install git to compile a production libmraa!") set (VERSION "v0.7.2-dirty") endif ()