@@ -501,6 +501,8 @@ def cmake_workflow(self, src_dir, build_type, build_dir, install_dir, extra_args
501501 config_args .extend (["-DCMAKE_C_COMPILER=" + self .options .cc ,
502502 "-DCMAKE_CXX_COMPILER=" + self .options .cxx ])
503503
504+ if self .is_windows ():
505+ config_args .extend (["-DPYTHON_EXECUTABLE=" + sys .executable ])
504506 # "OptimizedDebug" is not a valid build type. We interpret it as a special case
505507 # where the build type is Debug and optimizations are enabled.
506508 # This is equivalent to RelWithDebInfo on Unix, but ensures
@@ -1151,6 +1153,7 @@ def create_cmake_presets(self):
11511153 if cxx_flags :
11521154 new_preset ["cacheVariables" ]['CMAKE_CXX_FLAGS' ] = cxx_flags .strip ()
11531155
1156+ new_preset ["cacheVariables" ]["PYTHON_EXECUTABLE" ] = sys .executable
11541157
11551158 # Update cache variables path prefixes with their relative equivalents
11561159 mrdocs_src_dir_parent = os .path .dirname (self .options .mrdocs_src_dir )
@@ -1398,8 +1401,9 @@ def generate_clion_run_configs(self, configs):
13981401 if 'folder' in config :
13991402 attrib ["folderName" ] = config ["folder" ]
14001403 clion_config = ET .SubElement (root , "configuration" , attrib )
1404+ args = config .get ("args" ) or []
14011405 ET .SubElement (clion_config , "option" , name = "SCRIPT_TEXT" ,
1402- value = f"{ shlex .quote (config ['script' ])} { ' ' .join (shlex .quote (arg ) for arg in config [ ' args' ] )} " )
1406+ value = f"{ shlex .quote (config ['script' ])} { ' ' .join (shlex .quote (arg ) for arg in args )} " )
14031407 ET .SubElement (clion_config , "option" , name = "INDEPENDENT_SCRIPT_PATH" , value = "true" )
14041408 ET .SubElement (clion_config , "option" , name = "SCRIPT_PATH" , value = config ["script" ])
14051409 ET .SubElement (clion_config , "option" , name = "SCRIPT_OPTIONS" , value = "" )
0 commit comments