引用Qt Creator中项目目录的变量? [英] Variable that refers to the project directory in Qt Creator?

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

问题描述

我正在开发一个跨平台的Qt应用程序,并且在Mac OS X和Windows上的路径是不同的.由于项目位于外部硬盘驱动器上,因此驱动器号有时也会在Windows上更改.

I'm working on a cross-platform Qt application and the paths are different on Mac OS X and Windows. Since the project is on an external hard-drive, the drive letter also occasionally changes on Windows.

因此,我想使用变量(最好是内置变量)来引用项目目录.特别是,是否有这样的变量可用于:

For that reason, I would like to refer to the project directory using a variable, preferably a built-in one. In particular, is there such a variable usable in:

  • .pro文件?
  • 构建设置(在项目"选项卡中)?

推荐答案

内置的

The built-in _PRO_FILE_PWD_ variable contains the path to the directory containing the project file in use. That variable may be useful for you.

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

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