views:

17

answers:

0

I'd like to create a custom build rule in VS2010 that will run on project items that have a certain file extension.

They need to run a command line tool as follows:
"FullPathToTool.exe" "FullPathToInputFile"

The tool then generates a c++ file that I'd like to be compiled along with other C++ files already in the project.

I've found this discussion of an existing build rule, but it doesn't seem very clear:
http://blogs.msdn.com/b/vcblog/archive/2010/04/21/quick-help-on-vs2010-custom-build-rule.aspx

I don't really understand what the properties mean or what needs to go in each of the files MyBuildRule.targets, MyBuildRule.props or MyBuildRule.xml

I also tried upgrading a visual studio 2008 .rules file that worked, but I get the following build error:
C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6001: Invalid command line switch for "cmd.exe". Illegal characters in path.

Do you know what needs to create a custom build rule or do you have any links to explanations? Some kind of tutorial on creating custom build rules in 2010 would be ideal.

Or, if you've got any ideas on how to fix the build error, that would be appreciated too.

Thanks.