In qmake is there a way to tell extra targets when they are out of date?
For the following configuration I can call any one of the defined extra targets for example make copy_zip and the dependent target commands are run in the expected order but they run every time. In the qmake documentation it doesn't mention how to specify an out-of-date test.
TARGET = demo
SOURCES = main.cpp
add_resource.commands = mkdir -p $${OUT_PWD}/$${TARGET}.app/Contents/Resources/ $$escape_expand(\n\t)
add_resource.commands += cp $$PWD/resource.dat $${OUT_PWD}/$${TARGET}.app/Contents/Resources/
add_resource.depends += first
create_zip.commands = zip -r $${OUT_PWD}/$${TARGET}.zip $${OUT_PWD}/$${TARGET}.app
create_zip.depends += add_resource
copy_zip.commands = cp $${OUT_PWD}/$${TARGET}.zip $${OUT_PWD}/$${TARGET}.zip.dat
copy_zip.depends = create_zip
QMAKE_EXTRA_TARGETS += add_resource create_zip copy_zip
If this turns out to be not possible with extra targets then is there another way to do it?
This is how I did it (on MacOS).
QMake .pro file:
After calling
qmake <file>.prothe new targets can be built using e.g.make .copy_zip.