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
option in configure
script but this option is not available on Windows.
I know I can use Qt right from the build folder but it does not seem the right thing not to perform an install step. One problem with this approach is size; Qt's build folder takes about 4GB space whereas after installing using binary installer Qt takes about 1GB space. I guess the difference is due to temporary files created during building. I hope some install procedure would install (copy) only needed files leaving temporary files in the build folder.
相关问题
- How does the setup bootstrapper detect if prerequi
- QML: Cannot read property 'xxx' of undefin
- slurm: use a control node also for computing
- QTextEdit.find() doesn't work in Python
- Inheritance impossible in Windows Runtime Componen
相关文章
- ubuntu20.4中c#通过c++库调用python脚本
- 如何让cmd.exe 执行 UNICODE 文本格式的批处理?
- 怎么把Windows开机按钮通过修改注册表指向我自己的程序
- Qt槽函数自动执行多遍
- Warning : HTML 1300 Navigation occured?
- Getting errors / failing tests when installing Pyt
- How do you make an installer for your python progr
- Bundling the Windows Mono runtime with an applicat
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.
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:
Replace
<path>
with the full path of your Qt directory after you moved it (theqtbase
directory if you are using Qt 5). Omit the finalqt5
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.Qt's own build instructions show how this is done, by search/replace within each Makefile. Assuming the source was extracted to C:\qt-4.8.3 and build was performed within that directory, then do this:
Then create a config file that tells qmake about its new installation path. Create a textfile C:\my-install-dir\bin\qt.conf:
Then as a final step (as Randy kindly pointed out) you need to patch qmake.exe, which can be done using a simple utility called QtMove. This same tool also automatically updates all the
prl
files.I can configure QT 5 on WINDOWS (Visual Studio build) with the prefix option like:
then call:
and the latter will install Qt in C:\the\path\I\want.
I did it without problems with Qt 5.2.1 and 5.3.x, so far. So, any earlier problems seem to be fixed by now.
It's very odd people claim that there is no "make install" on Windows.
I have used it many times, and I agree that it's not what it is on other platforms, but it serves its purpose.
How I use Qt's make install on Windows (from cmd):
The make install bit copies all necessary headers to be able to delete your source directory. Delete all objects and unecessary stuff:
This allows you to remove the source directory. I don't know what impact this has on debugging Qt source code, but it sure reduces the size of a shadow build. I use it to maintain 32 and 64 bit builds with minimal size.
Step 1: Move Qt
Step 2: Get Old Qt Directory
Step 3: Patch Qt
Step 4: Set Environment Variables
You can do all of this with a batch file. This took me a fair while to work out and it has saved me a lot of time since. It's a script to automatically update a Qt installation to new locations. The batch file is available here.
Qt on Windows is not installable with
make install
, you will notice that Qt installer for Windows just patches dlls & pdbs for the new install location.What I would suggest is to do a shadow build in the place you would like to install it. You can manually remove
*.obj
files to save up space.