How to set installation path for qt project

I am looking for an equivalent. / configure --prefix = for qmake. Basically, I want to override the default installation / deployment directory. How is this indicated on the qmake command line? I also use QtCreator to create a large number of my gui projects, and I would like to know how to do the same by creating inside QtCreator. Is there a variable that I can process in .pro files for this, or change project settings?

Thanks!

+6
source share
2 answers

I found a solution for this, and it is as simple as specifying the -prefix option to configure.

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

qmake PREFIX=/usr/local 

There are two ways to do this in QtCreator. First, you can modify your .pro file to include the explicit definition of the PREFIX variable. However, this is not recommended, as the prefix is ​​preferred for each user, and it is preferable to distribute common project files. The best way to do this is in your own project settings. Just go to the assembly configuration that you are using, expand the qmake options and add PREFIX = to the additional arguments.

+5
source

It seems to me that qmake PREFIX = / usr / local does not work (try with qtcreator source)

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

 make INSTALL_ROOT=/usr/local make install 
+7
source

Source: https://habr.com/ru/post/889640/


All Articles