Hi there,
Is there a way to specify a default build directory name in CMakePresets.json or in some other way? I prefer to specify something other than the default `build` or `build_1` names.
Hi there,
Is there a way to specify a default build directory name in CMakePresets.json or in some other way? I prefer to specify something other than the default `build` or `build_1` names.
Hi mlac,
Do you want to change the default name, so that subsequent builds generate "new_name," "new_name_1," "new_name_2," and so on?
Or do you just want to specify a name for your build directory?
If you only want to specify a name for your build directory, then you can use the -d or --build-dir option of west build. (Refer: Building, Flashing and Debugging — Zephyr Project documentation (nRF Connect SDK) (nordicsemi.com))
Hieu
Hi Hieu,
I want to specify the *default* build directory names so that when developers check out the git repo and add build configurations, Visual Studio Code will offer the intended default build directory name.
I want to specify per-build default build directory names.
Hi mlac,
You only want to change the default build directory name in the nRF Connect VS Code Extension, right?
I don't see an option for that in the extension's configuration, and think it is not possible. Nonetheless, I have asked the extension developers to see if there are any alternatives. I will keep you updated.
Have the extension developers replied, Hieu?
Hi mlac,
Hieu is on leave this week, so I'll be taking over here.
mlac said:Have the extension developers replied, Hieu?
They have. Unfortunately it seems that there is no feature for this currently, but they agree that it's something they could add.
Although they currently don't think the "default build directory name" warrants an entry in the VS Code settings, they plan to make new builds respect the binaryDir field from the CMakePreset:
The presets have a binaryDir field that specifies the name of the build directory. This is stored correctly when saving a build as a preset, but it's not picked up when you select the preset in the build window. I'll add a ticket for this, as this should be picked up from the preset.
I hope that answers your questions.
Best regards,
Raoul
I literally just made an account to request this exact same feature. I hope you'll consider giving it a high priority, i have the exact same issue/need as mlac. I'm sharing a git repo and would like to use a CMakePresets.json (or some other automatic revision controlled means) to specify build directory names as I have multiple build configs for a single application that requires too many manual steps to get setup currently.
I'd also like to add that I want to specify directories like `build/my-hardware-revision`, and if the build parent directory doesn't exist, it should be created by the VS Code extension.
I'd also like to add that I want to specify directories like `build/my-hardware-revision`, and if the build parent directory doesn't exist, it should be created by the VS Code extension.
Hi all,
Your requests have been noted! I hadn't seen this use case myself but it makes a lot of sense, I hope to see it coming soon.
mlac said:if the build parent directory doesn't exist, it should be created by the VS Code extension.
I have now shared this as well. Thanks!
Best regards,
Raoul