Qt Project Files and PREFIX Variable

i am on

PREFIX = /usr/local 

inside my project file and then I run

 qmake myproject.pro 

The Makefile says nothing about PREFIX, although I assume that I am doing something wrong. Any ideas?

+7
source share
3 answers

PREFIX means nothing in qmake files. The target for files is accomplished using the target parameter. Therefore, if you want PREFIX to determine the base location, for example /usr/local , you can do something like this:

 isEmpty(PREFIX) { PREFIX = /usr/local } TARGET = myapp TARGET.path = $$PREFIX/ 

isEmpty(PREFIX) will allow you to change it during a command line call to qmake, for example.

 qmake PREFIX=/opt 
+10
source

If you want to pass PREFIX to qmake, you can do the following:

  • Open projects from the left panel or using the Ctrl+5 key
  • Expand Build Steps
  • Add PREFIX=/your/path/ to the Additional Arguments field
0
source

That is, the INSTALL_ROOT variable during installation, try
make install INSTALL_ROOT="your path"

0
source

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


All Articles