qt - 如何在 Qt-Creator 中添加自定义构建步骤?

标签 qt build-process qt-creator

构建我的应用程序后,我想将其复制到特定目录(在 Windows 7 上)。

自定义构建步骤

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

但是我有错误:

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

这是错误的吗?

最佳答案

一种方法是更改​​ .pro 文件中的构建输出目录。 类似的东西

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

或者根据您的具体情况

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

编辑: 这个question我的答案有一些很好的替代方案。

关于qt - 如何在 Qt-Creator 中添加自定义构建步骤?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4438919/

相关文章:

tfs - 如何配置 TFS 构建过程以通过测试 Controller 在测试代理上执行测试?

android - Android 版 Qt : QtCreator build/deploy error when executing step "Build Android APK"

javascript - 从 QT 中的 javascript 访问 QML Canvas

c++ - 如何从对话框中返回 QStringList

c++ - 如何为文件对话框过滤器设置通配符?

iphone - 如何加密捆绑的文本/json 文件?

gradle - 没有存储库的Gradle独立项目的最佳实践

c++ - QT Subdir-未定义对 main 的引用-错误

qt - Qt Creator 2.5.2 中缺少移动 Qt 应用程序

c++ - Qt:如何在模型/ View 设置中同步访问来自多个线程的数据?