In add-in for VS2012 you can get AdditionalIncludeDirectories by doing the following (note that this is per project configuration rather than per project):
You need to add reference to the "Microsoft.VisualStudio.VCProjectEngine" assembly.
using Microsoft.VisualStudio.VCProjectEngine;
EnvDTE.Project project = null; // You get this project from somewhere
VCProject vcProject = project.Object as VCProject;
IEnumerable projectConfigurations = vcProject.Configurations as IEnumerable;
foreach (Object objectProjectConfig in projectConfigurations)
{
VCConfiguration vcProjectConfig = objectProjectConfig as VCConfiguration;
IEnumerable projectTools = vcProjectConfig.Tools as IEnumerable;
foreach (Object objectProjectTool in projectTools)
{
VCCLCompilerTool compilerTool = objectProjectTool as VCCLCompilerTool;
if (compilerTool != null)
{
string additionalIncludeDirs = compilerTool.AdditionalIncludeDirectories;
break;
}
}
}
To get the <"INCLUDE" directories from Visual Studio> you can 'ask' configuration to evaluate the VS "IcludePath" variable:
string includeDirs = vcProjectConfig.Evaluate("$(IncludePath)");