How to add an hierarchy of Include Directories to a C project in MSVC?

2.2k views Asked by At

I am trying to maintain an ARM command line (makefile) project using the MSVS 2013 Express IDE, to take advantage of the IDE's advanced code analysis capabilities.

The project consists of dozens of directories, each including a "src" and an "include" directories. In order for Intellisense to "understand" the various tokens, I need to add all those "include" directories to the Additional Include Directories search path.

Is there a way to recursively add all folders of a project's filesystem to the path?

1

There are 1 answers

2
James McNellis On BEST ANSWER

If all you want is decent IntelliSense support and don't actually need the projects to build, then you can add the directories to your project as <ClInclude/> items that contain wildcards, e.g.

<ClInclude Include="path\to\root\*\include\*.h" />

You can add as many of these as you'd like and match whatever patterns you need using *. You'll need to add these to the project file manually (using a text editor); the IDE doesn't fully support items that contain wildcards.