tags:

views:

36

answers:

2

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

+2  A: 

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
Kyle Lutz
+4  A: 

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 .

Troubadour