I understand why this request was made but all it really does it move the dependency from your project to your IDE environment.
This ends up being worse when it comes to sharing code because your environment may differ from someone else's. At least when it comes to including files within the source code, you can clearly see what file dependencies are missing rather than getting hit with a missing procedure error and not knowing what library it actually belongs to.
For example:
Lets say that your environment knows about "SomeFile.pbi" so you don't have to include it in your source. Then your environment changes, you share you source with someone, or revisit it some time later with a different configuration. Now suddenly you get an error about a missing procedure definition:
Of course, there is no include anywhere so you have no idea where this function is actually defined since it's part of some environment setting.
If you are having trouble managing source dependencies, the answer isn't to cram everything into the IDE; it's to learn better source control practices.
For my configuration I set a custom constant which points to my source repository:
Code: Select all
CODESPUNK_HOME="C:\development\repositories\libcodespunk"
Then in my source I include a relative path:
Code: Select all
XIncludeFile #CODESPUNK_HOME+"/purebasic/h.SAL.pb"
XIncludeFile #CODESPUNK_HOME+"/purebasic/h.Types.pb"
If for some reason I change the location of my repository then I only need to update the constant and everything else propagates out.
The only problem with this is that if my development environment goes out of sync or if I move to a different machine with a different path then this breaks. I have a feature request to address this issue:
http://www.purebasic.fr/english/viewtop ... =3&t=66630
In my opinion, the best layout is:
Code: Select all
Environment Variables (variable)
-> Constants (inherit environment)
-> Includes (relative to constants)
This allows code to be very portable and easily configurable across different computers, operating systems, and other environments.