saberrao
saberrao

Reputation: 31

How to make the projects in a solution have the same include,lib path

In visual Studio 2010, I want to make all of the projects in one solution have the same configuration such as the include directory,the lib directory? I know there is a thing called property manager that can do this, but it makes other solutions have the same configuration.

Is there some ways to deal with it:Only let the projects in the same solution have the same configuration and don't affect other solutions?

Upvotes: 3

Views: 290

Answers (1)

cxxl
cxxl

Reputation: 5379

What you can do is make your own .props file. If you open the .vcxproj file with a text editor, you can find some lines down the file something like this:

<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />

That imports (or includes or calls) some other .props file. Look for that file and use a text editor to open it, here it is in C:\Program Files\MSBuild\Microsoft.Cpp\v4.0. This gives you and idea of how .props files are structured.

Now, you can make your own .props file and in it set the include and lib paths like you want them (maybe set additional settings as well) and finally you have to add an <Import.../> line in your .vcxproj files manually. Don't worry, VS will not remove it, even if you make changes to the project.

Helpful web sites for .props programming:

Upvotes: 1

Related Questions