Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a pragma directive for include directories?

As the title says: Is there a pragma directive for include directories using VS20** C++? I think about something like:

#pragma comment(include, "..\externals\blah\includes\")

So that I can use includes in this style, and blah.h also can use this style inside?

#include <blah.h>

I know that I can set include directories in my project settings, but I am asking for a preprocessor directive, because else i would have to set it for every compiler profile.

Regards Nem

like image 247
Christoph Meißner Avatar asked Aug 15 '11 19:08

Christoph Meißner


1 Answers

you can create a txt file (ex. IncludeDirs.txt). Inside that file you can add the include folders:

/I "."
/I ".."
/I ".\OtherFolder"

then in the properties->configuration properties->C/C++-> Command line add the following string:

@includedirs.txt

You can create a different file for each profile (Debug, Release, etc.)

like image 167
FreeRideX Avatar answered Sep 27 '22 21:09

FreeRideX