openframeworks/openFrameworks — Issue #767: #include <lib/header.h> instead of #include <header.h>
Author: gimlids
Created: 2011-10-09 03:58:30+00:00
State: open

When integrating openFrameworks into existing build systems, it would make things easier if this common include convention was followed.

i.e. to include openFrameworks headers in my own build, because all the includes look like:

#include "ofMesh.h"
#include "ofAppGlutWindow.h"
#include "ofSerial.h"

I have to add all these paths to my include paths:

../Libraries/of_preRelease_v007_linux64/libs/openFrameworks
../Libraries/of_preRelease_v007_linux64/libs/openFrameworks/app
../Libraries/of_preRelease_v007_linux64/libs/openFrameworks/3d
../Libraries/of_preRelease_v007_linux64/libs/openFrameworks/communication
../Libraries/of_preRelease_v007_linux64/libs/openFrameworks/gl
../Libraries/of_preRelease_v007_linux64/libs/openFrameworks/graphics
../Libraries/of_preRelease_v007_linux64/libs/openFrameworks/utils
../Libraries/of_preRelease_v007_linux64/libs/openFrameworks/types
../Libraries/of_preRelease_v007_linux64/libs/openFrameworks/math
../Libraries/of_preRelease_v007_linux64/libs/openFrameworks/events

It is common to instead structure files like (in the case of openFrameworks):

oF/include/oF
oF/include/oF/app
oF/include/oF/3d
oF/include/oF/communication
oF/include/oF/gl
oF/include/oF/graphics
...etc...

and just write:

#include
#include

etc.

I'm not sure if there is an argument to leave it like it is because it's easier for oF's demographic? But I would say teaching the some_lib/include/some_lib/ convention would help people use more C++.