Default build directory name in CMakePresets.json

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.

Parents Reply Children
  • 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.

  • 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

Related