From bb6ffacd86046ba8c2cff51bf2688cb4e2043bd2 Mon Sep 17 00:00:00 2001 From: Gaute Hope Date: Sun, 7 Apr 2019 14:06:26 +0200 Subject: [PATCH] cmake: make git describe work out of source tree --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c77402d92..29b7232aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,7 +40,7 @@ set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") if (CMAKE_BUILD_TYPE STREQUAL "Debug") # debug build - retrieve current project version from git execute_process ( - COMMAND git describe --abbrev=8 --tags --always + COMMAND git -C "${CMAKE_SOURCE_DIR}" describe --abbrev=8 --tags --always OUTPUT_VARIABLE PROJECT_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE )