Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

%(AdditionalIncludeDirectories) meaning

Think this will be rather simple but somehow I could not find a reference saying about this.

In the MSVC Include directories, there is an Additional Include Directories setting. The setting reads like this

..\Project1; %(AdditionalIncludeDirectories)

Understand the first part is the path for the program to search for additional program header includes. What about " %(AdditionalIncludeDirectories) " ? what does it mean?

It does not seem to be a macro which I understand is headed by "$" eg $MACRO

Thanks

like image 206
user1538798 Avatar asked Oct 10 '13 02:10

user1538798


People also ask

How do I add another directory in Visual C++?

Adding The Include DirectoryGo to the Visual Studio Project Property Pages dialog (From the Project menu, select Properties, or right-click on the project in the Solution Explorer). Select Configuration Properties, C/C++, General, and then add $(PIXELINK_SDK_ROOT)\include to the Additional Include Directories field.

How can I change C++ compiler in Visual Studio?

In Visual Studio You can set compiler options for each project in its Visual Studio Property Pages dialog box. In the left pane, select Configuration Properties, C/C++ and then choose the compiler option category.

How do I add the include path in Visual Studio?

In Solution Explorer (a palette-window of the VisualStudio-mainwindow), open the shortcut menu for the project and choose Properties, and then in the left pane of the Property Pages dialog box, expand Configuration Properties and select VC++ Directories. Additional include- or lib-paths are specifyable there.

How do I select C++ version in Visual Studio?

To set this compiler option in the Visual Studio development environment. Open the project's Property Pages dialog box. For more information, see Set C++ compiler and build properties in Visual Studio. Select the Configuration Properties > C/C++ > Language property page.


1 Answers

Answer

In the documentation for Working with Project Properties there is a section on "item macros":

Item macros

Has the syntax %(name). For a file, an item macro applies only to that file—for example, you can use %(AdditionalIncludeDirectories) to specify include directories that apply only to a particular file. This kind of item macro corresponds to an ItemGroup metadata in MSBuild. When it's used in the context of a project configuration, an item macro applies to all files of a certain type. For example, the C/C++ Preprocessor Definitions configuration property can take a %(PreprocessorDefinitions) item macro that applies to all .cpp files in the project. This kind of item macro corresponds to an ItemDefinitionGroup metadata in MSBuild. For more information, see Item Definitions.

Discussion

I had exactly the same problem in a project I am taking over from a former developer : his Additional Include Directories are C:\Users\t-tshmit\Downloads\DirectXTK;$(ProjectDir);$(IntermediateOutputPath);%(AdditionalIncludeDirectories)

Additional Include Directories flyout

And oddly the %(AdditionalIncludeDirectories) element is not included in the edit box

Edit box for Additional Include Directories

Looking around the web I could not find much on this, but it is clearly a pattern in use, for example the screenshot used in http://www.steptools.com/support/stdev_docs/help/settings_vc10.html may contain the %(AdditionalIncludeDirectories) element.

The documentation for both the Additional Include Directories compiler options and the AdditionalIncludeDirectories VCCL Compiler Tool property contain no mention of this %(NAME) pattern.

like image 91
dumbledad Avatar answered Oct 24 '22 01:10

dumbledad