@@ -510,8 +510,12 @@ def cmake_workflow(self, src_dir, build_type, build_dir, install_dir, extra_args
510510
511511 # If the cmake script happens to look for the python executable, we
512512 # already provide it on windows because it's often not in PATH.
513- if self .is_windows () and self .options .python_path :
514- config_args .extend (["-DPYTHON_EXECUTABLE=" + self .options .python_path ])
513+ if self .is_windows ():
514+ if self .options .python_path :
515+ config_args .extend (["-DPYTHON_EXECUTABLE=" + self .options .python_path ])
516+ if self .options .git_path :
517+ config_args .extend (["-DGIT_EXECUTABLE=" + self .options .git_path ])
518+ config_args .extend (["-DGIT_ROOT=" + os .path .dirname (self .options .git_path )])
515519
516520 # "OptimizedDebug" is not a valid build type. We interpret it as a special case
517521 # where the build type is Debug and optimizations are enabled.
@@ -1252,8 +1256,13 @@ def create_cmake_presets(self):
12521256 if cxx_flags :
12531257 new_preset ["cacheVariables" ]['CMAKE_CXX_FLAGS' ] = cxx_flags .strip ()
12541258
1255- if self .is_windows () and self .options .python_path :
1256- new_preset ["cacheVariables" ]["PYTHON_EXECUTABLE" ] = self .options .python_path
1259+ if self .is_windows ():
1260+ if self .options .python_path :
1261+ new_preset ["cacheVariables" ]["PYTHON_EXECUTABLE" ] = self .options .python_path
1262+ if self .options .git_path :
1263+ new_preset ["cacheVariables" ]["GIT_EXECUTABLE" ] = self .options .git_path
1264+ new_preset ["cacheVariables" ]["GIT_ROOT" ] = os .path .dirname (self .options .git_path )
1265+
12571266
12581267 # Update cache variables path prefixes with their relative equivalents
12591268 mrdocs_src_dir_parent = os .path .dirname (self .options .mrdocs_src_dir )
0 commit comments