When building my project i want qt to copy the appropriate dll files of opencv depending on the build, either profile
/release
or debug
.
For now i have the following first approach in my .pro
file:
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!
when debug build is set and release build!
when release build is set.
But the corresponding dll files only get copied in debug build.
So how can I get Qt to allways copy the corresponding dll files?
Your approach can also include a full distinction between opencv's debug and release dll's since this is the ultimate goal...