From: Shuanglei Tao Date: Thu, 18 Jun 2020 14:53:43 +0000 (+0800) Subject: cmake: update git command args (#293) X-Git-Url: http://git.prime8.dev/?a=commitdiff_plain;h=b08d10693378a724230ecf2ad75c2a757cf7edca;p=ttyd.git cmake: update git command args (#293) --- diff --git a/CMakeLists.txt b/CMakeLists.txt index efd76d2..f08fc00 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,8 +6,7 @@ set(PROJECT_VERSION "1.6.0") find_package(Git) if(GIT_FOUND) execute_process( - COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + COMMAND ${GIT_EXECUTABLE} --git-dir ${CMAKE_CURRENT_SOURCE_DIR}/.git rev-parse --short HEAD RESULT_VARIABLE GIT_RET OUTPUT_VARIABLE GIT_COMMIT OUTPUT_STRIP_TRAILING_WHITESPACE