From ffc26eea08050180eaac7af8b1903498c1e24619 Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 21 Jul 2022 20:24:03 +0300 Subject: [PATCH] Fix GIT_EXECUTABLE usage. --- CMake/GetGitRevisionDescription.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMake/GetGitRevisionDescription.cmake b/CMake/GetGitRevisionDescription.cmake index 73fe1cc14..a99610c43 100644 --- a/CMake/GetGitRevisionDescription.cmake +++ b/CMake/GetGitRevisionDescription.cmake @@ -69,10 +69,12 @@ function(get_git_head_revision _refspecvar _hashvar) return() endif() + find_package(Git) + # Check if the current source dir is a git submodule or a worktree. # In both cases .git is a file instead of a directory. # - if (NOT IS_DIRECTORY ${GIT_DIR}) + if ((NOT IS_DIRECTORY ${GIT_DIR}) AND Git_FOUND) # The following git command will return a non empty string that # points to the super project working tree if the current # source dir is inside a git submodule.