Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add include/lib directory to all projects in MSVC 2015 solution?

I have a big solution and adding/changing include directories in each project is extremely tedious. Is it possible to set common include folder for all projects in one step?

Thanx.

like image 211
Stepan Yakovenko Avatar asked Jan 02 '18 10:01

Stepan Yakovenko


1 Answers

The non-intuitive first step is to select multiple projects in the Solution Explorer window. Collapse the project nodes first if necessary. Click the first project then Shift+Click the last project. Make changes to the selection if necessary by using Ctrl+Click to remove or re-add projects from/to the selection. Then Right-Click > Properties.

Select VC++ Directories and make your changes to the Include Directories setting.

If appropriate you can first change the Configuration combobox at the top of the dialog to "All Configurations" or the Platform combobox to "All Platforms" so the changes apply to all configurations and/or platforms. Beware that might change a setting to <different options>, it can then only merge new additions.

A completely different way to do this is by creating a property sheet that all projects use. It is still tedious to set this up but hopefully you'll only need to do this once. Kick that off with View > (Other Windows) > Property Manager. You can use the Shift+Click trick there as well, useful to add a new property sheet to all of them. This existing Q+A talks about it.

like image 120
Hans Passant Avatar answered Sep 17 '22 12:09

Hans Passant