How can the install path be set for a qt project

时光毁灭记忆、已成空白 提交于 2020-01-14 09:00:55

问题


I'm looking for the equivalent to ./configure --prefix= for qmake. Basically, I want to override the default install/deployment directory. How is this specified with command line qmake? I also use QtCreator to build a lot of my gui projects, and I'd like to know how to do the same thing while building inside of QtCreator. Is there a variable that I can manipulate in the .pro files to do this, or do I change my project settings?

Thanks!


回答1:


For me, it seems that qmake PREFIX=/usr/local doesn't work (try with the source of qtcreator)

So the solution is to use qmake normally, but then, you do

make
INSTALL_ROOT=/usr/local make install



回答2:


I've found the solution to this, and it is just as easy as specifying the --prefix option to configure.

For qmake on the command line, you simpy add a PREFIX= parameter:

qmake PREFIX=/usr/local

There are two ways to do this in QtCreator. First, you could change your .pro file to include an explicit PREFIX variable definition. However, this is not recommended, as the prefix is a preference specific to each user, and it is preferable to keep the distributed project files generic. A better way to do this, is in your own project settings. Simply go to the build configuration that you are using, expand the qmake settings, and add PREFIX= to the additional arguments.



来源:https://stackoverflow.com/questions/6217093/how-can-the-install-path-be-set-for-a-qt-project

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