vscode-cmake-tools icon indicating copy to clipboard operation
vscode-cmake-tools copied to clipboard

Automatically configure when switching kits

Open Colengms opened this issue 5 years ago • 7 comments

When switching kits, it's necessary to also run Configure to configure with the kit. Perhaps switching kits should automatically trigger configuration? Or, short of that, perhaps add a setting to enable configuration when switching kits. There is an existing setting to auto configure on open. These could be merged, so CMake is always maintained in a configured state. Though, even when not (re-)configuring on open, it would seem beneficial to always configure when switching kits.

Colengms avatar Jan 11 '20 00:01 Colengms

Just as a side note: In VS2019 configurations can be defined in CMakeSettings.json and when switching between them, the configuration happens in a new directory. When switching kits with the VSCode extension - the configuration is done in the same location. This needs to be taken into consideration too.

Zingam avatar Jan 12 '20 07:01 Zingam

@Zingam The configuration will be done in different locations if you make use of variables in the cmake.buildDirectory.

bobbrow avatar Jan 13 '20 16:01 bobbrow

if it is going to be added then it should be customizable. I often change kits and sometimes by accident and don't want to trigger a configure always

zrno avatar Jan 13 '20 22:01 zrno

@bobbrow Thank you for reminding me about these variables. Should we have predefined configurations/environments VS2019 style in the VSCode extension? https://docs.microsoft.com/en-us/cpp/build/cmake-predefined-configuration-reference?view=vs-2019

Zingam avatar Jan 14 '20 06:01 Zingam

@Zingam can you create a new feature request for that? Thanks!

bobbrow avatar Jan 14 '20 16:01 bobbrow

I use different build directories for different kits, and automatic configuration will harm my usage. So this should probably be at least optional/configurable. Maybe it's possible for vscode-cmake-tools to detect, whether actual value of buildDirectory (after variables substitution) has been changed due to switching kits, and re-configure depending on this.

alex-che avatar May 19 '20 16:05 alex-che

Any news on this?

MartinsSmirnovs avatar Sep 01 '22 13:09 MartinsSmirnovs