开发者

How can the install path be set for a qt project

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 t开发者_C百科o 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!


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜