Qt project files and PREFIX variable

∥☆過路亽.° 提交于 2019-11-29 07:04:46

PREFIX doesn't mean anything in qmake files. The target for files is done via the target parameter. So if you want to make PREFIX determine the base location, such as /usr/local, you can do do something like this:

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

The isEmpty(PREFIX) will allow it to be changed during the command line call to qmake, e.g.

qmake PREFIX=/opt

If you like to pass PREFIX to qmake, so you can do as follow:

  • Open Projects from left pan or using Ctrl+5 key
  • Expand Build Steps
  • Add PREFIX=/your/path/ into Additional arguments field

That is INSTALL_ROOT variable on install, try
make install INSTALL_ROOT="your path"

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