Run a task before resources compilation in Qt Creator
-
Hi all
I need to run a task before resources compilation start (that is the first compilation starting). Create a new target and assign to PRE_TARGETDEPS and QMAKE_EXTRA_TARGETS doesn't work since RESOURCES compilation always start before, then execute my additoonal target task and after start normal sources compilation. I still din't find a way to have some task runned as first on compilation. Someone can help me?
Thank you -
Not sure, but maybe hacking around it with a custom compiler could help: http://doc.qt.io/qt-5/qmake-advanced-usage.html#adding-compilers
-
OK, another idea :-)
Add 2 new .pro files, like so:
main.pro before/before.pro yourCode/yourCode.pro
Then in main put this:
CONFIG += ordered TEMPLATE = subdirs SUBDIRS = before yourCode
And in before.pro handle all things you have to execute before yourCode.pro kicks in.
CONFIG+=ordered
ensures that the .pro files will be executed in the same order they are specified.If that does not work, I'd say the only thing left is to create a shell script and run it manually before build (or maybe switch to cmake if it supports such use case).