PDA

View Full Version : How to know what configuration type shared|static



cafu1007
31st March 2011, 14:09
hi there,

I have a question:
In the .pro file while compiling i can check if the qt configuration is static or shared using this:
CONFIG(static, static|shared)

I would like to know if there is a way to do this in the code as well somthing like this

#ifdef Qt_SHARED
//do something
#elif define(Qt_STATIC)
//do something else
#endif

thanks for the help

stampede
31st March 2011, 16:12
You can always define yourself:


build_pass:CONFIG(static, static|shared){
DEFINES += STATIC_BUILD
} else{
DEFINES += SHARED_BUILD
}


Then in code:


#ifdef STATIC_BUILD
// static build code
#elif defined(SHARED_BUILD)
// shared build code
#endif

cafu1007
31st March 2011, 16:46
Thanks for the answer, i know this but what i do not want to do is to add that lines to all .pro files?

thanks,