Using Qt 5.12
. I have been trying to make some QMake commands to run only once (instead of three times). I found this answer, where they make use of the !build_pass
condition. So I set up my working directory as follows:
│ subdirs_test.pro
│
└───test
test.pro
The test/test.pro
file only contains:
!build_pass:message("This message should appear only once")
And the subdirs_test.pro
contains:
TEMPLATE = subdirs
SUBDIRS = \
test
test.subdir = $$PWD/test
If I run:
cd test
qmake -tp vc test.pro
Well enough it prints:
Project MESSAGE: This message should appear only once
But if I run the subdirs
project:
cd ..
qmake -r -tp vc subsdirs_test.pro
It prints the message twice:
Project MESSAGE: This message should appear only once
Project MESSAGE: This message should appear only once
Is there a way to make QMake just run it once?