1

I need to build VC++ project (made in VS2008) from command line using MSBuild with additional .cpp file which isn't part of this project (doesn't listed in section of .vcproj file. Is there are any way to do this? (e.g. just by passing filename to command line input).

Editing .vcproj file by my script is also is a option but I save it for a worst scenario when there are no way to do it just with MSBuild.

2
  • Why exactly do you need to do this? What's the problem being solved? Commented Feb 24, 2010 at 12:43
  • There are several projects containing code students wrote as reply to the question. I'm asked to develop system which adds to every projects a .cpp file containing unit tests, builds up all projects, run them, parse output generated by tests and summarize it in html-file. This is if I put it simple. Commented Feb 24, 2010 at 16:31

2 Answers 2

1

I don't think you can point MSBuild at a project file and tell it to build this project and add another file at the same time. I'd either update the .vcproj file to include the file you're trying to add or go for the script-driven editing approach. Actually, I'd probably just change the .vcproj file as I'd think this is the safer approach and less likely to break something.

Sign up to request clarification or add additional context in comments.

Comments

0

You can add the file to the project if it's in the same directory.

If it's shared / in another directory you can try adding as a link.

In the Add / Existing Dialog notice the Arrow on the edge of the add button. Try clicking it.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.