Change Qt install path after building?

a 夏天 提交于 2019-12-18 01:25:12

问题


how can I change Qt install path after I building it ?

Example : qmake.exe search binaries to original install path, how can I change/redefine it ?

Thanks.

Edit : I finally found this patch to apply to Qt :

  • http://ftp-developpez.com/qt/binaires/win32/patcher/QtPatcher.7z
  • http://ftp-developpez.com/qt/binaires/win32/patcher/QtPatche_src.7z

回答1:


I was looking into this and found a way that works (in qt 4.7.2) by customizing qt with a qt.conf file.

In my case, I added a qt4-4.7.2/bin/qt.conf (I think it must be in the same place as the qmake executable)

With the following contents:

[Paths]
Prefix = c:/my_path/to/qt4-4.7.2

and the qmake -query started returning the proper paths!

See: http://qt-project.org/doc/qt-5.0/qtdoc/qt-conf.html for more details




回答2:


You can change path to binaries and many other hardcoded paths in qmake using qmake -set command.
See Configuring qmake's Environment for details.




回答3:


I can answer it for windows, not so sure about others. Remove the path variables if any present in the environmental variable PATH.

In Qt-Creator goto,

Tools->Options->Qt4->Qt Versions

In the right hand side area, you will find Auto- Detected and Manual. Under Manual add a new entry by clicking the + symbol in the far right. Specify the QMake location by clicking Browse . Change the Default Qt Version to your newly specified Version. Of course, you have to re -build the application. Hope that it helps.




回答4:


On unix you can make a symbolic link, otherwise you probably need to rebuild it




回答5:


On Unix/Linux:

You can also use LD_LIBRARY_PATH+PATH for workarounds. But still, some defaults are hardcoded in the code, yes. A rebuild is a must.



来源:https://stackoverflow.com/questions/2905868/change-qt-install-path-after-building

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!