How to install Qt on Windows after building?

后端 未结 8 411
死守一世寂寞
死守一世寂寞 2020-12-02 09:55

I can\'t find any information on how to install Qt built on Windows.
In wiki article How to set up shadow builds on Mac and Linux there\'s description of -prefix

相关标签:
8条回答
  • 2020-12-02 10:52

    This answer is a replacement for steps 3 and 5 of Piotr's (currently top rated) answer above, but you may still need the other steps in his answer, depending what you're trying to achieve.

    • This is the operation which the official installer uses to fix the hardcoded paths during the installation: qt.520.win32_msvc2012.addons/meta/installscript.qs
    • This is how the operation is implemented: qtpatchoperation.cpp
    • This is the list of files that it fixes: files-to-patch-windows-qt5
    • And this shows how to invoke an installer operation as a standalone command from the commandline: Operations (Qt Installer Framework Manual)

    To summarize: after moving your Qt directory to where you want it, download any one of the official Qt installers and run it with the following commandline arguments:

    cd <path>
    installer.exe --runoperation QtPatch windows <path> qt5
    

    Replace <path> with the full path of your Qt directory after you moved it (the qtbase directory if you are using Qt 5). Omit the final qt5 argument if you are using Qt 4.

    This will fix the hardcoded paths in qmake.exe, .prl files, and others. It gives you the exact same behaviour that the official installers have in that respect.

    For the initial move, nmake "INSTALL_ROOT=\somewhere" install works for me. So that's steps 1 and 2 of Piotr's answer covered. And I haven't needed steps 4 or 6, FWIW.

    0 讨论(0)
  • 2020-12-02 10:54

    There is a simple utility QtMove (http://www.runfastsoft.com) can do this easily.

    Runs the relocated qmake.exe build your .pro file and everything should be linked with new Qt libs.

    0 讨论(0)
提交回复
热议问题