vendredi 24 juillet 2015

Global macro definition in C++ per project

Is there a way do define a global macro, like _DEBUG in VS 2013 to be global per project? I want to use macro for conditional buld for different versions of application and avoid to include *.h.file containing the definition.

#define APP_VERSION_MAJOR 1
#define APP_VERSION_MINOR 0
#define APP_VERSION_HOTFIX 0
#define APP_VERSION_DEV a

#define APP_VER_STR_(s) #s
#define APP_VER_STR(s) APP_VER_STR_(s)

#define APP_VERSION APP_VER_STR(APP_VERSION_MAJOR) "." APP_VER_STR(APP_VERSION_MINOR) "." APP_VER_STR(APP_VERSION_HOTFIX) "." APP_VER_STR(APP_VERSION_DEV)

Aucun commentaire:

Enregistrer un commentaire