From 95eef05f28ca30db29c0083815c70e83636362b4 Mon Sep 17 00:00:00 2001 From: scivision <7365-scivision@users.noreply.gitlab.kitware.com> Date: Wed, 26 Aug 2026 13:21:05 -0400 Subject: [PATCH] Add option(CMake_VERSION_NO_GIT) for broken Git or slow filesystem Help inform user in GUI that it's possible to build CMake without Git. This is useful for Git on Windows Subsystem for Linux or other platforms where filesystem access for Git is very slow or Git program is broken. Fixes: #28051 --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ca18091296..258e9b382b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -442,6 +442,10 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE) endif() endif() +if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/.git") + option(CMake_VERSION_NO_GIT "Do not attempt to determine CMake version from Git" OFF) +endif() + #----------------------------------------------------------------------- # The main section of the CMakeLists file #