views:

58

answers:

2

Hello,

I'm using the Custom Build Rules feature in Visual Studio 2005, which allows to use macros such as $(ConfigurationName) in the XML .rules file.

I need to pass only a subset of $(ConfigurationName) as a parameter to my command-line tool:

If my target is named "DebugBuild", I'd like the command to end up like "tool.exe -Debug".

Is there a way to do this? I thought about creating a user-defined macro, but I don't know if they can contain more than plain text. What I have in mind is to end up with something like this in my custom property pages:

Either "Tool Parameter: $(MyMacroWhichExtractsPartOfTheConfigurationName)"

Or "Tool Parameter: ExtractorMethod( $(ConfigurationName) )"

Sorry if this is not very clear, I can give more details if needed :)

Thanks!

Guillaume

A: 

Usually I create a script (eg minsys bash or windows bat) which you run, and which translates the arguments to what you want, rather than trying to do it within VS.

Pete Kirkham
A: 

The problem is that there are several places where I'd like to have this functionality available (output name, parameter to the compile/link steps, parameter to the post-build step...), so the script solution would make things a bit convoluted. I'd like to keep it simple, if at possible. Thanks!