How can i add custom build steps in Qt-Creator?

半腔热情 提交于 2019-12-10 23:58:09

问题


After build my app, i want copy it to specific directory (on Windows 7).

Custom build step

cmd.exe \c \k copy MyPlugin.dll ..\..\..\HostApp\Debug\plugins

But I have error:

Can't run process "cmd.exe \c \k copy MyPlugin.dll ..\..\..\HostApp\Debug\plugins"

That's wrong?


回答1:


One way to do it would be to change the build output directory in the .pro file. Something like

CONFIG(debug, debug|release) {
    DESTDIR = C:/myApp/debug
} else {
    DESTDIR = C:/myApp/release
}

Or in your particular case

CONFIG(debug, debug|release) {
    DESTDIR = ..\..\..\HostApp\Debug\plugins
} else {
    DESTDIR = ..\..\..\HostApp\Release\plugins
}

Edit: This question has some good alternatives to my answer.



来源:https://stackoverflow.com/questions/4438919/how-can-i-add-custom-build-steps-in-qt-creator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!