I have a third party precompiled library (.lib+.dll) that I use in my Qt application.
In a regular (qmake) QtCreator project I have the following lines in my .pro file:
LIBS += -L$$PWD/lib/release -ltag
INCLUDEPATH += include/taglib
There is also an option in Projects tab -> Run -> "Add build library search path to PATH" which is by default ON. It ensures that LIBS path gets added to system PATH, so the dll can be found.
However, I can't find an equivalent in QBS. I have the following qbs file, which then gets included and added via Depends in my CppApplication file:
DynamicLibrary {
name: "taglib"
files: "lib/release/tag.dll"
Export {
Depends { name: "cpp" }
cpp.includePaths: [".","include/taglib"]
cpp.libraryPaths: ["lib/release"]
cpp.dynamicLibraries: "tag"
}
Group {
name: "taglib"
fileTagsFilter: ["dynamicLibrary"]
qbs.install: true
}
}
The linker passes but the application can't find the DLL at runtime and crashes. Is it possible to add cpp.libraryPaths to system PATH at runtime?
Another option would be to copy the DLL file to build directory, but I can't figure out how to do that for precompiled libraries in QBS.
EDIT: I tried to use cpp.systemRunPaths which is documented here but it doesn't work.