简体   繁体   English

Qt-qmake安装仅适用于调试配置

[英]Qt - qmake INSTALL only works for debug configuration

When building my project i want to copy the appropriate files of depending on the build, either profile / release or debug . 在构建我的项目时,我希望根据构建( profile / releasedebug复制的相应文件。

For now i have the following first approach in my .pro file: 现在,我在.pro文件中具有以下第一种方法:

CONFIG(debug, debug|release) {
    OPENCV_PATH = $$OUT_PWD/debug
    OPENCV_DLLS += $$files("$$PWD/../../opencv-build/install/x64/vc15/bin/*d.dll", true)
    LIBS += $$files("$$PWD/../../opencv-build/install/x64/vc15/lib/*d.lib", false)
    message(debug build!)
} else {
    OPENCV_PATH = $$OUT_PWD/release
    OPENCV_DLLS += $$files("$$PWD/../../opencv-build/install/x64/vc15/bin/*.dll", true)
    LIBS += $$files("$$PWD/../../opencv-build/install/x64/vc15/lib/*.lib", false)
    message(release build!)
}

opencv.files += $$OPENCV_DLLS
opencv.path = $$OPENCV_PATH

INSTALLS += opencv

When running qmake or changing the deployment i allways get the correct Project MESSAGE which is debug build! 当运行qmake或更改部署时,我总是获得正确的Project MESSAGE ,这是debug build! when debug build is set and release build! 设置调试版本并release build! when release build is set. 设置发布版本时。

But the corresponding dll files only get copied in debug build. 但是相应的dll文件仅在调试版本中被复制。

So how can I get Qt to allways copy the corresponding dll files? 那么,如何让Qt始终复制相应的dll文件?

Your approach can also include a full distinction between opencv's debug and release dll's since this is the ultimate goal... 您的方法还可以包括opencv的调试和发行版dll的完全区别,因为这是最终目标。

I forgot to add the install command as a build step: 我忘了添加install命令作为构建步骤:

在此处输入图片说明

Now all files get copied. 现在,所有文件都将被复制。

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

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