Are the .pro file settings somehow accessible from within the code?
I want to use conditional compilation but I need to know whether testlib (or whatever)
QT += testlib
is added in the project file.
thanks in advance
Are the .pro file settings somehow accessible from within the code?
I want to use conditional compilation but I need to know whether testlib (or whatever)
QT += testlib
is added in the project file.
thanks in advance
Yes. If your application is compiled with the testlib, QT_TESTLIB_LIB
will be defined.
So you could to this:
#ifdef QT_TESTLIB_LIB
// test code
#endif
In addition to Kyle's answer you can also more generally make conditional checks on configuration and use these to set preprocessor macros with the DEFINES variable .