Reputation: 2393
As the tittle says I need a prebuild command CONDITION that executes an exe on build solution/project and passes when i use F5.
I found "$(ConfigurationName)" as a possible solution on some websites but it only works if you change each time the configuration type manually.
Anybody knows the trick??
Upvotes: 1
Views: 1660
Reputation: 35911
I think what you actually want is a seperate build configuration or some condition that does not run the events when you are developping/debugging, right? Here are two ways I can think of:
IF "%RUN_PREBUILD%" == "1" (echo not running postbuild) ELSE (/path/to/prebuild.command)
Now to make this completely nice, assign two 'external tools' in VS, one that sets the variable to 0 and one that sets it to 1 (use setx to set environment variables). You can now add these commands to the toolbar, so the only thing you need to do is click a button to specify if prebuild should happen or not.Upvotes: 1
Reputation: 7282
F5 will only build the project if there are any changes in code. So I don't think you can issue a command that will always trigger an prebuild command when using F5.
Upvotes: 0