We work with a project directory structure that contains quite some (sub)folders. When making use of the Add include functionality, the include that is added always contains a relative path.
Consider following directory structure: project\\package1\\class1.h project\\package1\\implementation\\class1.cpp project\\package2\\class2.h project\\package2\\implementation\\class2.cpp
when doing a Add include for Class1 and Class2 in class1.cpp, the following include statements are generated: #include "..\\class1.h" #include "..\\..\\package2\\class2.h"
What we would like to have is the following: #include "package1\\class1.h" #include "package2\\class2.h"
as we have a a INCLUDEPATH which is set to the root of our project.
Is there anyway to force VAX to generate the includes in this fashion?
system info: VA_X.dll file version 10.6.1859.0 built 2011.10.02 DevEnv.exe version 10.0.40219.1 Professional msenv.dll version 10.0.40219.1 Comctl32.dll version 6.10.7601.17514 Windows 7 6.1 Build 7601 Service Pack 1 4 processors (x86-64;WOW64)
I must say we have this issue for quite a while already..
we have some (old) custom make system... So the /I parameters are then eventuall passed to the cl throught this make system. Our makesystem is triggered by using in VisualStudio the project type Makefile.
In the NMake Configuration Properties we then specify following properties: Build Command Line: makeit.cmd build Debug Rebuild All Command Line: makeit.cmd rebuild Debug Clean Command Line: makeid.cmd clean Debug
So what we would need is something in VAX where we can configure these include paths ourselves... (something like the stable includes or so...)
In the test solution that we built, adding "." fixed the include of class2.h but the include of class1.h still used a relative path (..\\class1.h) since it was shorter than "package1\\class1.h". The next build will give you the option of overriding the bias towards shorter paths that use ".." (when possible, given the include directories).
In build 1862 and higher, you can change the default behavior of preferring the shortest possible string for use in generated #include directive paths. There is a new binary registry value named AddIncludePreferShortestRelativePath. It defaults to 01. Change to 00 to to give preference to non ..\\ dirs.