[Interest] How do i copy the QML files to debug folder without adding make install?

Harri Pasanen harri at mpaja.com
Sat Jun 16 23:24:17 CEST 2012


On 06/16/2012 10:07 PM, Mark wrote:
> Hi,
>
> If one makes a Qt Quick application you get a whole bunch of special
> code inside a .pri file that copies the QML files to the debug/release
> location _without_ having the need to add a make install. That is
> exactly what i want to have, but i don't want to have the massive .pri
> file nor is my app a "Qt Quick Application". I just want to copy a QML
> file after compilation to the DESTDIR and somehow that seemingly
> simple thing is close to impossible QMake.
>
> Can anyone help me with this? I'm trying this from Qt Creator and
> Windows but obviously it needs to work in Linux a well.
>
> I tried the solution in here:
> http://stackoverflow.com/questions/3984104/qmake-how-to-copy-a-file-to-the-output
> (the one with the QMake function) but that is also not working.

This is how camerademo does it, obviously only meant to be used on Windows:

simulator {
     CONFIG(debug, debug|release) {
         system(mkdir 
..\\camerademo-build-simulator-Simulator_Qt_for_MinGW_4_4__Qt_SDK__Debug\\qml)
         system(mkdir 
..\\camerademo-build-simulator-Simulator_Qt_for_MinGW_4_4__Qt_SDK__Debug\\qml\\symbian)
         system(mkdir 
..\\camerademo-build-simulator-Simulator_Qt_for_MinGW_4_4__Qt_SDK__Debug\\qml\\images)
         system(copy .\\qml\\symbian\\* 
..\\camerademo-build-simulator-Simulator_Qt_for_MinGW_4_4__Qt_SDK__Debug\\qml\\symbian)
         system(copy .\\qml\\images\\* 
..\\camerademo-build-simulator-Simulator_Qt_for_MinGW_4_4__Qt_SDK__Debug\\qml\\images)
     }
     else {
         system(mkdir 
..\\camerademo-build-simulator-Simulator_Qt_for_MinGW_4_4__Qt_SDK__Release\\qml)
         system(mkdir 
..\\camerademo-build-simulator-Simulator_Qt_for_MinGW_4_4__Qt_SDK__Release\\qml\\symbian)
         system(mkdir 
..\\camerademo-build-simulator-Simulator_Qt_for_MinGW_4_4__Qt_SDK__Release\\qml\\images)
         system(copy .\\qml\\symbian\\* 
..\\camerademo-build-simulator-Simulator_Qt_for_MinGW_4_4__Qt_SDK__Release\\qml\\symbian)
         system(copy .\\qml\\images\\* 
..\\camerademo-build-simulator-Simulator_Qt_for_MinGW_4_4__Qt_SDK__Release\\qml\\images)
     }
}


Hope this helps,

Harri



More information about the Interest mailing list