在mingw中,qmake copy_dir总是错误

beh*_*god 4 qt qmake

我想将一些 qml 复制到我的构建目录中。
\n在 中.pro,我添加:

\n\n
copydata.commands = $(COPY_DIR) \\"$$PWD/plugins\\" \\"$$DESTDIR/plugins\\"\n
Run Code Online (Sandbox Code Playgroud)\n\n

但是当我构建项目时,出现copydata错误。\n错误消息是:

\n\n
\n

xcopy /s /q /y /i\n "E:/myproject/src/plugins"\n "E:/myproject/bin/debug/plugins"\n 参数数量无效

\n
\n\n

但是,我把命令复制到cmd,就可以了。

\n\n

有谁知道 \xef\xbc\x9f 出了什么问题

\n

beh*_*god 6

我得到了它!
谢谢你,macetw,你指明了方向。

正确的代码应该是:

copydata.commands = $(COPY_DIR) $$shell_path($$PWD/plugins) $$shell_path($$DESTDIR/plugins)
Run Code Online (Sandbox Code Playgroud)