@@ -510,8 +510,12 @@ def cmake_workflow(self, src_dir, build_type, build_dir, install_dir, extra_args
510
510
511
511
# If the cmake script happens to look for the python executable, we
512
512
# 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 )])
515
519
516
520
# "OptimizedDebug" is not a valid build type. We interpret it as a special case
517
521
# where the build type is Debug and optimizations are enabled.
@@ -1252,8 +1256,13 @@ def create_cmake_presets(self):
1252
1256
if cxx_flags :
1253
1257
new_preset ["cacheVariables" ]['CMAKE_CXX_FLAGS' ] = cxx_flags .strip ()
1254
1258
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
+
1257
1266
1258
1267
# Update cache variables path prefixes with their relative equivalents
1259
1268
mrdocs_src_dir_parent = os .path .dirname (self .options .mrdocs_src_dir )
0 commit comments