The qmake manual documents a touch
function to update the time stamp of a file, see: touch(filename, reference_filename). It is recommended here to update the timestamp on a file, e.g.:
version.commands = touch $$version.target
Note: the qmake manual documents two parameters, e.g.:
version.commands = touch $$version.target $$version.depends
However, I can't get the touch
function to work on Windows using either call. I suspect that qmake
is simply calling the linux
touch command, since it works fine on Fedora 23.
A workaround is to create a touch.cmd
command file on Windows, e.g.:
@COPY /B %1+,, %1
and use the following in the .pro
file:
version.commands = $$system(touch $$version.target)
But I would prefer to use the qmake touch
function...
What is the correct way to invoke it in a .pro
file so that it works on Windows?