如何将包含目录的层次结构添加到MSVC中的C项目? [英] How to add an hierarchy of Include Directories to a C project in MSVC?

查看:149
本文介绍了如何将包含目录的层次结构添加到MSVC中的C项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用MSVS 2013 Express IDE维护一个ARM命令行(makefile)项目,以利用IDE的高级代码分析功能。

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.

project包含许多目录,每个目录包括一个src和一个include目录。为了让Intellisense理解各种令牌,我需要将所有这些include目录添加到Additional Include Directories搜索路径。

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?

推荐答案

如果你想要的只是体面的IntelliSense支持而实际上并不需要项目 build ,然后您可以将目录添加到项目中< ClInclude /> 包含通配符的项目,例如

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" />

您可以根据需要添加任意数量的这些,并使用<$匹配您需要的任何模式C $ C> * 。您需要手动将这些添加到项目文件中(使用文本编辑器); IDE不完全支持包含通配符的项目。

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.

这篇关于如何将包含目录的层次结构添加到MSVC中的C项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆