From 7fa192700e31d2f0f00fd8ad3c25861deb705929 Mon Sep 17 00:00:00 2001 From: Guerra Mattia Date: Fri, 2 Feb 2018 14:19:04 +0100 Subject: [PATCH] CMake: protect replacement of COMMIT_LIST Signed-off-by: Guerra Mattia --- cmake/MacroVersionFromGit.cmake | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmake/MacroVersionFromGit.cmake b/cmake/MacroVersionFromGit.cmake index d574f26..94931c6 100644 --- a/cmake/MacroVersionFromGit.cmake +++ b/cmake/MacroVersionFromGit.cmake @@ -23,11 +23,13 @@ IF (TAG_LIST AND NOT VERSION) OUTPUT_VARIABLE COMMIT_LIST OUTPUT_STRIP_TRAILING_WHITESPACE) - STRING (REPLACE "\n" ";" COMMIT_LIST ${COMMIT_LIST}) + IF (COMMIT_LIST) + STRING (REPLACE "\n" ";" COMMIT_LIST ${COMMIT_LIST}) - LIST (LENGTH COMMIT_LIST MINOR_VERSION) + LIST (LENGTH COMMIT_LIST MINOR_VERSION) - SET (DAEMONVERSION "${VERSION_MISSING_MINOR}.${MINOR_VERSION}") + SET (DAEMONVERSION "${VERSION_MISSING_MINOR}.${MINOR_VERSION}") + ENDIF (COMMIT_LIST) ENDIF (TAGLIST AND NOT VERSION) if (NOT DAEMONVERSION) -- 2.7.4