I have one requirement. I have a project lets Say baseProject.vcxproj. It has some header files. Another project lets say dependentProject.vcxproj loads baseProjects's dll and uses some of its header files.
When some other project lets say unrelatedProejct includes the header file from e dependentproject which includes baseproject's header file. It makes to change the include driectory setting of unrelatedproject.
unrelatedProject
some.h or some.cpp
{
#include "dependent.h"
//In this case it will include base.h also and needs to change it's include direcotries settings.
}
I'm not sure what you mean by "visible". If a file in UnrelatedProject includes dependent.h, then it will also need to include base.h. UnrelatedProject therefore needs to know where to find base.h .
You could treat baseproject as a separate component that is installed to a standard location. Have the header files installed to a common includes directory, e.g. C:\MySoftware\include - or, more sensibly, to a subdirectory of that standard directory named, e.g., "baseproject".
Then make all your projects have "C:\MySoftware\includes" in their include path.
You'll have to make sure that your include statements qualify the header file with the subdirectory:
#include "baseproject/base.h"
This means you'll only have to alter your projects once, to add C:\MySoftware\include to the path. Then, if you need to add other dependencies, you won't need to modify the settings over and over again - just add new subdirectories to the common include directory, and ensure those subdirectories are used to qualify the include statements.
Alternatively, if you're using MSVC, you can use Property Sheets. Have a single sheet that specifies all the header directories you need. Then have all your projects inherit the same Property Sheet. Then, in future, if you need to add more dependencies to all projects, you just update the single Property Sheet, so that all projects automatically inherit the new setting.
Note that, if you're including headers from baseproject, then you'll probably need to link against the libraries from baseproject too. You'll need to do something analogous to the above with library files and paths.