Shared variables in multi qmake directory

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

What is the best way to change the settings for the whole build system (eg release for debugging).

Currently I can only do this by modifying each sub.pro file or using an external script to modify each .pro file.

I was hoping there was a way to share qmake variables between the sub.ir file and others.

+2


a source to share


2 answers


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



+1


a source


Qt Creator takes care of the problem very well. When you compile a subdir project with configuration, all child projects are compiled using config.



And there is one shadow build directory for the whole project tree.

0


a source







All Articles