Onno
Onno

Reputation: 295

Have visual studio 2012 automatically copy referenced project's references (C++)

I'm working on a VS2012 solution. This solution has a C++ project as a main project. The main project references several external libraries, and I might add a couple of extra libraries as well in the future. The solution also has a C++ unit test project to test the code. I have a reference in the unit test project to the main project.

However, unlike with C# or other CLR-type projects, this somehow doesn't mean that the references in that project are copied. (might be that in those projects a .dll reference is all that seems to be necessary to get the job done)

I'm currently unable to include files from the main project, nor are the libraries that the main project has included or which it is linking to included in the test project.

I'd like to know if there's a way to access all the main project's files, include search directories and library references without editing the unit test project's properties all the time. Is there a way to do that? I've tried setting Use Library Dependency Includes to true in the unit test project's settings, but it keeps getting reset to false.

Will enabling copy local or copy local sattelite assemblies help solve this?

Upvotes: 0

Views: 272

Answers (1)

Marius Bancila
Marius Bancila

Reputation: 16318

Copying output of native project referred in other projects does not work like in .NET because the mechanisms are different. The one solution that comes to my mind now is adding a post-build event action to copy the output to the desired folder.

Upvotes: 1

Related Questions