qt项目如何设置安装路径

发布于 11-13 00:37 字数 196 浏览 5 评论 0原文

我正在寻找与 qmake ./configure --prefix= 等效的内容。基本上,我想覆盖默认的安装/部署目录。这是如何用命令行 qmake 指定的?我还使用 QtCreator 构建了很多 gui 项目,并且我想知道如何在 QtCreator 内部构建时执行相同的操作。我可以在 .pro 文件中操作一个变量来执行此操作,还是更改我的项目设置?

谢谢!

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 to 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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

雨落星ぅ辰2024-11-20 00:37:59

对我来说,似乎 qmake PREFIX=/usr/local 不起作用
(尝试使用 qtcreator 的源代码)

所以解决方案是正常使用 qmake,但是,你这样做

make
INSTALL_ROOT=/usr/local make install

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
违心°2024-11-20 00:37:59

我已经找到了解决方案,它就像指定 --prefix 选项来配置一样简单。

对于命令行上的 qmake,您只需添加一个 PREFIX= 参数:

qmake PREFIX=/usr/local

在 QtCreator 中有两种方法可以做到这一点。首先,您可以更改 .pro 文件以包含显式 PREFIX 变量定义。但是,不建议这样做,因为前缀是特定于每个用户的首选项,并且最好保持分布式项目文件通用。更好的方法是在您自己的项目设置中。只需转到您正在使用的构建配置,展开 qmake 设置,然后将 PREFIX= 添加到其他参数即可。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文