Skip to main content
Visitor II
November 17, 2025
Question

Project broken after git clean (Project setup in CMake)

  • November 17, 2025
  • 1 reply
  • 230 views

Hello,

I have a small problem here. When I run a clean in git, the directories .vscode, .settings, and build are deleted. If the project needs to be rebuilt, the Setup STM32Cude project function has to be executed manually, and the board/device has to be specified manually again. This is very error-prone.

2025-11-17 16_51_31-.png

Is there a way to start this project setup from CMake or from CMakePresets.json?

For example, if no compiler was found?

In CMake, the correct settings are already known.

    This topic has been closed for replies.

    1 reply

    Graduate II
    November 22, 2025

    @jwichmann why not adding these .settings & .vscode stuff to your source control resources ?

    Myself I'm not hurted to consider any tool has the need for internal metadata ... they are part of the project kind of.

    Looking at STM32Cube native proposal creating a so called empty project an .gitignore file is promoted ... it's crystal clear .settings has to be preserved

    Cartu38OpenDev_0-1763798812849.png

     

    jwichmannAuthor
    Visitor II
    November 24, 2025

    Because user-specific configurations are also stored in the .settings and .vscode directories. In my opinion, these have no place in a GIT repository.

    For example, .settings/bundles.store.json stores whether st-link or j-link is used as the programmer. This is a matter of user preference, but not really relevant to the project. It should also not be relevant whether GCC or Clang is used as the compiler. This should be controlled by the CMake file itself, as well as compiler switches in the code. The paths of the current toolchain are stored in .vscode/settings.json.

    I found out that if I keep the .settings/ide.store.json file, I can achieve the project setup with the desired default settings. Even if CMake configure is executed automatically three times, twice with compiler errors and the third time correctly.

    Graduate II
    November 24, 2025

    @jwichmann you are kind of confirming all my points :-).


    @jwichmann wrote:

    I found out that if I keep the .settings/ide.store.json file, I can achieve the project setup with the desired default settings. Even if CMake configure is executed automatically three times, twice with compiler errors and the third time correctly.


    Demonstrates these metadata are must have. Why are they must have ? Because they are supporting your local system install management promoting to VSCode extensions paths to must have binaries which are compilers, debuggers acting under the hood of VSCode. VSCode is only a GUI ... all the rest is out of VSCode.
    Stuff is failing at first ages because .settings metadata not taken into account at first.  At first regular CMake Tools extension is acting and this extension is not aware of STM32Cube additions. Post CMake Tools contributions STM32Cube is acting and by magic stuff starts to work.


    @jwichmann wrote:

    Because user-specific configurations are also stored in the .settings and .vscode directories. In my opinion, these have no place in a GIT repository.


    Yes and I bet assumed by ST Thanks some other comments. Rational is to ensure reproducibility if you're sharing your project to a friend. Keeping these *bundle* stuff will kind of force your friend to execute your project back enjoying the very same setup. Thanks these metadata your projet is really self contain ... not only application sources but tools moving with.

    WDYT ?