From 0001460efaad628d9b187948690bf300d25177dd Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 4 Mar 2013 20:36:09 +0100 Subject: Suppress error message when no .git directory is found --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/CMakeLists.txt') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d0b767d..0478037 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -40,7 +40,7 @@ add_custom_target( version COMMAND echo "#ifndef _FASTD_VERSION_H_" > ${CMAKE_CURRENT_BINARY_DIR}/version.h.new COMMAND echo "#define _FASTD_VERSION_H_" >> ${CMAKE_CURRENT_BINARY_DIR}/version.h.new - COMMAND sh -c "echo \"#define FASTD_VERSION \\\"\$(git --git-dir=${FASTD_SOURCE_DIR}/.git --work-tree=${FASTD_SOURCE_DIR} describe --dirty || echo ${FASTD_VERSION})\\\"\"" >> ${CMAKE_CURRENT_BINARY_DIR}/version.h.new + COMMAND sh -c "echo \"#define FASTD_VERSION \\\"\$(git --git-dir=${FASTD_SOURCE_DIR}/.git --work-tree=${FASTD_SOURCE_DIR} describe --dirty 2>/dev/null || echo ${FASTD_VERSION})\\\"\"" >> ${CMAKE_CURRENT_BINARY_DIR}/version.h.new COMMAND echo "#endif /* _FASTD_VERSION_H_ */" >> ${CMAKE_CURRENT_BINARY_DIR}/version.h.new COMMAND cmp -s ${CMAKE_CURRENT_BINARY_DIR}/version.h.new ${CMAKE_CURRENT_BINARY_DIR}/version.h && rm ${CMAKE_CURRENT_BINARY_DIR}/version.h.new || mv ${CMAKE_CURRENT_BINARY_DIR}/version.h.new ${CMAKE_CURRENT_BINARY_DIR}/version.h WORKING_DIRECTORY "${FASTD_SOURCE_DIR}" -- cgit v1.2.3