Foam Version as a compile-time macro
Just a suggestion, but perhaps it would be useful to have the Foam version as a compile-time macro. For example, something like this for OF-1.5:
#define FOAM_MAJOR_REVISION 1
#define FOAM_MINOR_REVISION 5
Or something on similar lines (Maybe passed in to g++ with a -D option). Considering how member functions change over revisions, (like faceOwner instead of allOwner in polyMesh, for instance), backward compatibility is sometimes an issue. I agree that it makes code uglier because of #ifdefs all around the source code, but it might be handy to have...
For example, 1.5 == -DPROJECT_VERSION=1005000.
Unfortunately this breaks down horribly when versions contain non-digits (eg, like 1.5.x). I would thus avoid using it at all.
IMO the better method is to keep your code up-to-date with the latest developments and use branching within git if you also need to maintain code for legacy versions. This is not only much cleanier to read than piles of #ifdefs, but also avoids strange and possibly hard to trace bugs. For example, if you'd moved from 1.5 to 1.5.x, the wrong chunk would get evaluated here:
|All times are GMT -4. The time now is 16:02.|