Suma's macro solution is nice. You don't need to have two different macro's, though. C++ wil happily include a header twice. Just leave out the include guard.
So you'd have an foobar.h defining just
ENUM(Foo, 1)
ENUM(Bar, 2)
and you would include it like this:
#define ENUMFACTORY_ARGUMENT "foobar.h"
#include "enumfactory.h"
enumfactory.h will do 2 #include ENUMFACTORY_ARGUMENT
s. In the first round, it expands ENUM like Suma's DECLARE_ENUM
; in the second round ENUM works like DEFINE_ENUM
.
You can include enumfactory.h multiple times, too, as long as you pass in different #define's for ENUMFACTORY_ARGUMENT