Include directory
-
Hi
can I include headers using a application base directory variable? Something alike:
#include "$appBaseDir/blab/bllb.h
Thanks
Michael -
It's not needed. Why do you want doing it?
-
As far as I know in C/C++ you cannot. #include does not allow variable expansion. However you can achieve something like the following with a script or something alike. But I'm not sure what is your aim...
-
you can use something like this in your pro file:
@appBaseDir = /app/dir/
HEADERS += $${appBaseDir}/bllb.h@
in the needed cpp or h file you just use
@#include "bllb.h"@ -
Setting include paths is usually handled with the C/C++ flags. In qmake projects you add
@
INCLUDEPATH += $${appBaseDir}
@