How to copy Qt runtime DLLs to project output

后端 未结 4 1295
生来不讨喜
生来不讨喜 2021-02-01 15:46

I have a simple project created in Qt Creator (installed using Qt SDK 1.1.4). It runs just fine from within Qt Creator, but if I then browse to the output directory in Windows

4条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-01 15:58

    I ran into the same problem and jwernerny's solution helped me a lot. However, I was using Shadow Build on Window 7 and it needed a bit more tweeking.

    I also needed to set the DESTDIR according to the current configuration.

    In my case I wanted to copy *.qml files, that's how I achieved it:

    CONFIG(release, debug|release): DESTDIR = $$OUT_PWD/release
    CONFIG(debug, debug|release): DESTDIR = $$OUT_PWD/debug
    
    QmlFiles.path = $$DESTDIR/Qml
    QmlFiles.files += $$files(Qml/*.qml)
    
    INSTALLS += QmlFiles
    

    EDIT :

    Since I use Shadow Build I need to use $$OUT_PWD to get the output folder.

提交回复
热议问题