Build Preset values change slash to backslash

I have made several Build-Configurations for my device. These are using "Extra Kconfig fragments" and everything works a it should. 

Now I saved the Build configuration as preset. But if I make a new build-configuration with this preset, it is not possible to push the "Generate and Bild" button. Nothing happens.

After checking the settings I saw, that the path of the "Extra Kconfig fragments" is written with \ instead of /. If I clear this setting and select the same file in the dropdown-list, it is written with / and the Build can be done successful. 

I checked the "CMakePreset.json". Here are the paths with "/" so it seems to be correct.

Is there any reason why this / is changed with the \ ?

Maybe it´s a Windows-problem? I´m using Visual Studio Code 1.109.4 (OS: Windows_NT x64 10.0.26200)

Parents
  • Hi,

    Presets are supposed to use /. The / is also preferred by the JSON format and CMake so the paths you are seeing in CMakePreset.json seem correct. Generally, Windows uses \ to save file paths. / is accepted by Windows in CMake but there are a few factors to note. The issue can be due to Windows OS as you mentioned because the IDE normally saves the paths using \. So, the VS Code extension itself uses path separators as per Windows but it does support / as well. I think that when you save the configurations, CMake may be changing to the correct format by itself when managing CMakePreset.json. 

    Let me know if you have any further questions.

    Best Regards,

    Samruddhi

  • I´m not sure if CMake is doing the conversion from CMakePreset.json to the buil-configuration. But I know, that it is changed in the wrong way.

    I would like to find a solution that allows to use the CMakePreset.json like it should be. It is tedious and error-prone to have to manually correct the settings each time. This is especially true if another employee wants to work on this project later and may not know exactly what to do.

Reply
  • I´m not sure if CMake is doing the conversion from CMakePreset.json to the buil-configuration. But I know, that it is changed in the wrong way.

    I would like to find a solution that allows to use the CMakePreset.json like it should be. It is tedious and error-prone to have to manually correct the settings each time. This is especially true if another employee wants to work on this project later and may not know exactly what to do.

Children
Related