Click here to Skip to main content
15,892,809 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hopefully a quick and easy question,

I am setting up a custom build rule in Visual Studio 2008 (for Qt tool-chain). There is an "Outputs" property, which i assume specifies where the built file should go. But the tool takes the output path as a command line parameter "-o".

The rules that i have (from here), specify the output path both in the "Outputs" property and the "Command Line" property, like so:
Command Line:   %QTDIR%\bin\uic.exe [Inputs] -o "[UicPrefix]$(InputName)[UicExt]"
Outputs:        [UicPrefix]$(InputName)[UicExt]


Is there any way i can avoid the duplication and use the Outputs variable in the Command Line, like so:
Command Line:   %QTDIR%\bin\uic.exe [Inputs] -o "[Outputs]"
Posted

The outputs are used to determine whether the source needs to be rebuilt (is the output file out of date) so if you do not specify outputs the Custom Build will be skipped. Since you can use the Visual Studio macros for all these values there should be no problem in having them in both places.
 
Share this answer
 
Comments
Stefan_Lang 6-Oct-11 8:19am    
The outputs are used to determine whether the source needs to be rebuilt
Exactly.
if you do not specify outputs the Custom Build will be skipped
Ummm, actually I always thought if you enter nothing it will always be executed - after all, how else would you perform custom steps that don't produce new files (e. g. cleaning up temporary files)?
Richard MacCutchan 6-Oct-11 11:46am    
You may be right, it's a long time since I had a custom rule with no outputs.
Stefan_Lang 7-Oct-11 3:50am    
or maybe you were right after all - I've recalled a case that implies a solution to the seemingly (but not truly) impossible question I posed. See my response to XTAL256.
Richard MacCutchan 7-Oct-11 4:29am    
I'm intrigued; I will find a moment to test it sometime soon.
XTAL256 6-Oct-11 22:58pm    
I have actually heard of this behaviour, and i think Richard is right that the custom build rule will be skipped. I am not sure if it's correct, i just read it somewhere. It does sound strange, though.
you can run command lines after the build process in which you can use the VS variables. You find in some "build event" settings.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900