Unsolved 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.
-
@SGaist i use
However question is why qmake DEFINES written in test (isvalueok.pro) are available in src.pro when I build src.pro and how to make it separate. -
Can you share a minimal compilable example that reproduce this behaviour ?
-
@SGaist I could not reproduce it (
simplified working one code
In my large project I still have this problem. May be it is a bug of 5.8 as in 5.7 all worked correctly. -
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.
-
in pro file use
include(subfolderName/tests.pri)
change .pro files that are subprojets to .pri