简体   繁体   English

在 Qt 项目文件中正确使用 QMAKE_POST_LINK

[英]Properly using QMAKE_POST_LINK in Qt project file

When adding commands to QMAKE_POST_LINK using += operator should I need to add a semicolon?使用 += 运算符向 QMAKE_POST_LINK 添加命令时,我是否需要添加分号?

For example,例如,

QMAKE_POST_LINK += mv somefile1.dat /some_location1; # semicolon
QMAKE_POST_LINK += mv somefile2.dat /some_location2
...

Without the semicolon Qt doesn't separate the commands.没有分号 Qt 不会分隔命令。

Is this proper functionality?这是正确的功能吗?

You should add $$escape_expand(\n\t) at the end of the each command.您应该在每个命令的末尾添加$$escape_expand(\n\t)

Some examples (just took from my real app):一些示例(仅取自我的真实应用程序):

QMAKE_POST_LINK += "cp -f $$OUT_PWD/$$DESTDIR/crashreporter.app/Contents/MacOS/crashreporter $$MACX_APP_MACOS_DIR" $$escape_expand(\n\t)
QMAKE_POST_LINK += "cp -R" $$VMSCLSHARED_DYLIBS $$MACX_APP_FW_DIR/ $$escape_expand(\n\t)

Here is one yet example: https://gist.github.com/Wohlstand/3d9455c4baddc057de60e511f7280b87这是一个例子: https ://gist.github.com/Wohlstand/3d9455c4baddc057de60e511f7280b87

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM