【发布时间】:2016-03-23 14:58:31
【问题描述】:
qmake 手册记录了一个touch 函数来更新文件的时间戳,请参阅:touch(filename, reference_filename)。推荐here更新文件时间戳,例如:
version.commands = touch $$version.target
注意:qmake 手册记录了两个参数,例如:
version.commands = touch $$version.target $$version.depends
但是,我无法使用任一调用使 touch 函数在 Windows 上运行。我怀疑qmake 只是调用linux touch 命令,因为它在Fedora 23 上运行良好。
一种解决方法是在 Windows 上创建一个touch.cmd 命令文件,例如:
@COPY /B %1+,, %1
并在.pro 文件中使用以下内容:
version.commands = $$system(touch $$version.target)
但我更喜欢使用 qmake touch 函数...
在 .pro 文件中调用它以使其在 Windows 上运行的正确方法是什么?
【问题讨论】:
-
system(@COPY /B file.name "+,,") - 对我来说很好
-
它对我也有用@oklas,但它仍然不是难以捉摸的
qmake touch。继续bash on Windows 10...