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 <brendan.le.foll@intel.com>
This commit is contained in:
@@ -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.
|
# Make a version file containing the current version from git.
|
||||||
include (GetGitRevisionDescription)
|
include (GetGitRevisionDescription)
|
||||||
git_describe (VERSION "--tags")
|
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!")
|
message (WARNING " - Install git to compile a production libmraa!")
|
||||||
set (VERSION "v0.7.2-dirty")
|
set (VERSION "v0.7.2-dirty")
|
||||||
endif ()
|
endif ()
|
||||||
|
|||||||
Reference in New Issue
Block a user