Printing a list of QMake variables

While the documentation has a list of variables available in QMake, it is not an exhaustive list. You will have a lot of other variables available depending on your build environment.

An easy way to print everything that is available is to just add the following to your .pro file-

for(var, $$list($$enumerate_vars())) {
    message($$var)
    message($$eval($$var))
}

When you run QMake, you should see something like this-

Project MESSAGE: QMAKE_NM
Project MESSAGE: nm -P
Project MESSAGE: QT.webchannel.libexecs
Project MESSAGE: /Users/shantanu/Qt/5.6/clang_64/libexec
Project MESSAGE: QT.widgets.bins
Project MESSAGE: /Users/shantanu/Qt/5.6/clang_64/bin

Handy stuff!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s