Is it possible to add a #define _MYDEFINE_
in my header file based on some options in the project settings. For Ex: Suppose in my exposed header file (which is delivered along with the library) I have some macros like shown below:
#ifdef _MYDEFINE_
#define ABC 2
#else
#define ABC 4
#endif
Now, while building my library, I can add _MYDEFINE_
in my settings, but I don't want the user of the library to add _MYDEFINE_
in his project settings or code. Instead I want "#define _MYDEFINE_
" to automatically get added in the beginning of the header.
Note: #define _MYDEFINE_
should get added only when it is defined in my preprocessor settings. For other settings it should not get added.
If not possible through project settings, are there any innovative ways of getting it done? Any ideas are welcome.