c++ - Is there a concept like include directory aliases? -


I am using several third-party libraries in a cross-platform project. After all I have included my source in my repository Decided to do it, they do not need to download it again on every platform. It is allowed by license

To include headers from those libraries, I need to specify their file path. In some libraries, they have name / include / name / file.h

I would like to include the header in my code as always #include "name / file.h" where name is the name of the library. But I do not want to modify the library structure of the libraries nor do I want to copy all the headers into the directory included in my desired structure.

Is there a way to define other names in the directory? For example, the headings of bullet / src , Sqlite in the bullet physics titles are directly sqlite and SFML is in the sfml / include / SFML . I would like to specify something like this:

  #alias "dependency / bullet / src" "bullet" #alias "dependency / sqlite" "sqlite" #alias "dependency / sfml / include / SFML "sfml"  

so that becomes #include "sfml / System.hpp" . #include "dependency / sfml / included / sfml / System HPP ". .

The technique should not be in the preprocessor phase. It may also be a CMake flag to properly prepare projects, for example, I think that The compiler should be aware of this technique by any means, making it possible.

No ; The closest approach is the collection of the -i options on the command line.

In addition, if you subscribe to SFML If you do, then the recommended notation is #include "sfml / system hpp" ; you should write it in your code. Then you can fix the compile environment so that -independencies / sfml / Include is included in the compilation, or you use the symlink (if they are portable enough) such as sub code- such as SFML in the main directory that gives headlines to your project .

Software packages like SFML etc. Stalls are, titles will be placed in a directory - usually / usr / local / include / by default, and in a sub-directory under the usually there. That is, a directory will be / usr / local / include / SFML which will include the SFML header. It is likely that the same is true about other software packages. You should place these headers in some space within your building area so that the headers can be found normally - you will only specify the base include directory under which the headers are found (note: when If you install, the headers are placed in various sub-directories under a directory ... / include / bullet , so it also follows this conference.)

< P> From the system Meaning of Hne do otherwise, and when you fight the system, you lose it's going to work hard just flow.


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -