From 7428a76353b6af52fafc1fbe811991d31b6885cd Mon Sep 17 00:00:00 2001 From: LoveSy Date: Sun, 13 Nov 2022 20:08:54 +0800 Subject: [PATCH] Fix hash ver --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 62e77587..20f87f03 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -287,10 +287,10 @@ set(dobby.HEADER_FILE_LIST # --- # add build version -if (EXISTS "${CMAKE_SOURCE_DIR}/.git") +if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git") execute_process( COMMAND git rev-parse --short --verify HEAD - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE VERSION_COMMIT_HASH OUTPUT_STRIP_TRAILING_WHITESPACE )