开发者

Shared variables in multi directory qmake

I have multiple qmake .pro files which are called from a root .pro file with a subdirs template.

What is the best way to change a setting for the whole build system (eg. release to debug).

Currently I can only do this by changing each sub .pro file, or using an external script to change each .pro file.

I was hoping there was a way to share qmake variables between t开发者_运维百科he subdirs .pro file and the others.


The only way I know of doing this is through an include file: define all your variables in a vars.pri file at the root of your project and use include() in the .pro files to access the shared variable.


Qt Creator takes care of the issue quite nicely. When you compile a subdir project with a config all the child projects gets compiled with the config.

And for the all project tree a single shadow-build directory is used.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜