One of our users requested support for importing MSBuild property sheets into VisualGDB variables that could be used in custom actions and various settings, so we are publishing the instructions to achieve this here in case anyone else is looking for a similar feature.
First of all, create a property sheet file (e.g. test.props) that will define the necessary properties inside a PropertyGroup with the “UserMacros” label:
Then, add the following lines to the .vgdbsettings file (or the .vgdbcmake/.vgdbproj file when using advanced project types) directly under the VisualGDBProjectSettings2 element:
The Path element should contain the relative path to the property sheet file that is being imported. You can test it by adding a custom pre-build action running “cmd.exe /c echo $(TestProperty)”. In this example, it will output “TestValue”.
Although VisualGDB cannot fully evaluate MSBuild conditions, you can use the syntax below to limit the properties imported by VisualGDB: