Is there a concept like include directory aliases?
No; the nearest approach is a collection of -I
options on the command line.
Further, if you use SFML, the recommended notation is #include "SFML/System.hpp"
; that's what you should write in your code. Then you fix the compilation environment so that -Idependencies/sfml/include
is included in the compilation, or you use symlinks (if they're portable enough) to manufacture sub-directories like SFML
in the main directory that contains your project's headers.
When software packages like SFML are installed, the headers will be placed into a directory — normally /usr/local/include
by default, and usually in a sub-directory under there. That is, there would be a directory /usr/local/include/SFML
which would contain the SFML headers. The chances are the same is true of other software packages. You should install these headers in some location under your build area so that the headers can be found as normal — you'll simply specify the base include
directory under which the headers are found. (Note: when you install the Bullet Physics library, the headers are placed into a directory .../include/bullet
with various sub-directories underneath that, so it too follows this convention.)
Doing otherwise means fighting the system, and when you fight the system, you end up losing. It is harder work thatn simply going with the flow.
The short answer is "no".
There are a few different options:
- Symlinks - set up your own "myincludes" directory, and then link all the relevant files to there, in their relative position.
- Use more complex -I options to your project.
- Write your own pre-preprocessor (which translates a given
#include
into the "actual file in the actual place", given some set of rules) - Adjust the install directories of the respective projects.
- Don't do any of the above, and use the names as they appear on your actual filesystem.
I personally prefer the "don't do this" option. For one thing, moving/changing how files are included is more than likely to confuse some people, and third party code certainly won't be written this way, so you won't be able to use anyone else's code maintaining this style.