Qt 项目文件和 PREFIX 变量 [英] Qt project files and PREFIX variable

查看:75
本文介绍了Qt 项目文件和 PREFIX 变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我包括了

PREFIX = /usr/local

在我的项目文件中,然后我运行

inside my project file and then I run

qmake myproject.pro

makefile 没有说明任何关于 PREFIX 的内容,所以我认为我做错了什么.有什么想法吗?

The makefile doesn't say anything about PREFIX though so I assume that i'm doing something wrong. Any ideas?

推荐答案

PREFIX 在 qmake 文件中没有任何意义.文件的目标是通过 target 参数完成的.所以如果你想让 PREFIX 确定基址,比如 /usr/local,你可以这样做:

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/

isEmpty(PREFIX) 将允许在命令行调用 qmake 期间更改它,例如

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

qmake PREFIX=/opt

这篇关于Qt 项目文件和 PREFIX 变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆