qmake手册记录了一个更新文件时间戳的触摸功能,参见:
touch(filename,reference_filename).建议
here更新文件的时间戳,例如:
version.commands = touch $$version.target
注意:qmake手册记录了两个参数,例如:
version.commands = touch $$version.target $$version.depends
但是,我无法使用任一调用在Windows上使用触摸功能.我怀疑qmake只是调用linux touch命令,因为它在Fedora 23上工作正常.
解决方法是在Windows上创建一个touch.cmd命令文件,例如:
@COPY /B %1+,%1
version.commands = $$system(touch $$version.target)
但我更喜欢使用qmake触摸功能……