So today my colleague ask me ” I have a variable VERSION in .pro file (qmake project file) I want to use that variable in my C++ code, How to do that?”
After a little search on Google I figured that we have export project files variable as a macro for C/C++ code and it very easy.
As the per problem we want VERSION variable in C++ code. So in project file we write
DEFINES += VERSION=\\\"$$VERSION\\\"
and in C/C++ code just
qDebug()<< VERSION ;
this is just a awesome.