How to make DEFINES += SOMETHING to be visible only if current .pro file is being build
-
Hi, I have qmake template subdirs.
One subdir for project sources and one for unit tests.I want that when building tests.pro which depends on .h and .cpp files of src.pro the
TESTING_ENABLED
macro be defined.
But if I simply put line in tests.proDEFINES += TESTING_ENABLED
this define is seen over the project. How to mae it defined only if I compile tests.pro? -
Hi,
How exactly are you setting up you tests ?
I usually have each unit tests in its own project and if I need something I put in a .pri file that I include from the unit tests .pro file.
-
Hi,
How exactly are you setting up you tests ?
I usually have each unit tests in its own project and if I need something I put in a .pri file that I include from the unit tests .pro file.
-
Can you share a minimal compilable example that reproduce this behaviour ?
-
That's a possibility yes. The only way I currently see is to try to disable everything in your project and rebuild until you see the behaviour happening.