[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Patch-gnuradio] [PATCH 2/2] cmake: fix use of git describe when we are
From: |
Timo Juhani Lindfors |
Subject: |
[Patch-gnuradio] [PATCH 2/2] cmake: fix use of git describe when we are building a tagged version |
Date: |
Thu, 8 Dec 2011 00:57:46 +0200 |
This patch fixes the case where build fails with
Traceback (most recent call last):
File "<string>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'groups'
CMake Error at cmake/Modules/GrVersion.cmake:71 (list):
list index: 0 out of range (-0, 18446744073709551615)
Call Stack (most recent call first):
CMakeLists.txt:41 (include)
since
git describe --always --abbrev=8
does not always print sequence number and commit (in my case it
printed "v3.5.0git" since I had not made any changes since the
release).
---
cmake/Modules/GrVersion.cmake | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/cmake/Modules/GrVersion.cmake b/cmake/Modules/GrVersion.cmake
index 16338f1..13cc6bb 100644
--- a/cmake/Modules/GrVersion.cmake
+++ b/cmake/Modules/GrVersion.cmake
@@ -47,7 +47,7 @@ find_package(Git)
if(GIT_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git)
message(STATUS "Extracting version information from git describe...")
execute_process(
- COMMAND ${GIT_EXECUTABLE} describe --always --abbrev=8
+ COMMAND ${GIT_EXECUTABLE} describe --always --abbrev=8 --long
OUTPUT_VARIABLE GIT_DESCRIBE OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
--
1.7.2.5