anthonyvd
anthonyvd

Reputation: 7590

Avoid intermediate directories in VC++

I'm maintaining a build script that calls devenv or Incredibuild from the command line to build a dynamically generated Visual C++ 2010 solution made up of several hundred projects. We're looking into ways of improving our build and I was wondering if there was a way to tell VS to avoid using intermediate directories.

For example, say I have a project Foo in a solution Bar. When I build Bar, the output from Foo ends up both in Bar/Foo/$(Configuration)/$(Platform) and in Bar/$(Configuration)/$(Platform).

I'd like to know if there's a way (from the command line or by editing project files) to make devenv build directly in the solution's output directory and only there. Also, are there any reasons why I should/shouldn't do such a thing?

Upvotes: 3

Views: 8830

Answers (2)

Frank
Frank

Reputation: 41

DONT do that!!!! since there is a bug (I call this behaviour a bug) in MSBuild that when you do a rebuild of a project, all files of ALL projects that use the same Intermediate Directory will be deleted in the output folder before the project is Build...

Upvotes: 4

Martin Beckett
Martin Beckett

Reputation: 96109

Simply set the intermediate directory path in the .vcxproj files to the same as the solution output directory.

Assuming your projects don't have the same output filename as each other there is no problem mixing intermediate directories. You can also set it to create all the intermediate directories under TEMP or on another drive.

Upvotes: 6

Related Questions