[CMake] Eclipse generator - basic macros

Benjamin Schindler bschindler at inf.ethz.ch
Mon Jul 13 10:31:12 EDT 2009


Hi

I'm working on a project which builds both on linux and windows. I 
generated an eclipse project out of it which works basically fine but 
it's not able to recognize i.e. the __GNUC__ macro (and probably any 
other macro defined per default on gcc) are not recognized by eclipse. 
That means that by using a header like:

#if defined(_MSC_VER) && (_MSC_VER >= 1300)
#ifdef FLOW_DLL_EXPORT
#define FLOW_DLL _declspec(dllexport)
#else
#define FLOW_DLL _declspec(dllimport)
#endif
#else
#ifdef __GNUC__
#define FLOW_DLL
#endif
#endif

and then declaring a class like:

class FLOW_DLL something { .... };
will fool eclipse's parser. When I remove the #ifdef __GNUC__, it works. 
Is this an issue in the eclipse generator or in the eclipse parser?

Thanks
Benjamin





More information about the CMake mailing list