Qt World Summit: Register Today!

retrieve full comiler options in qmake

  • I want to retrive full compiler option in qmake including all -I options and -D options.
    I've tried $$join(DEFINES, " -D") $$join(INCLUDEPATH, " -I") but it doesn't contain Qt module informations such as -DQT_CORE_LIB nor -IC:\Qt\5.8\msvc2015_64\include\QtCore

    How can I get full compiler flags/options in qmake?

  • Lifetime Qt Champion


    Out of curiosity, what is your use case for that information ?

  • I need the information to run clang-tidy because it requires compile options to analyze source code.
    For instance, without include path for QtCore headers, it prints some kind of erros similar with 'header file not found' whenever it sees #include <QVector>.
    Although I can write it one by one, I'd like to make general method to run clang-tidy for my project.

  • Lifetime Qt Champion

    You should check the qmake variable reference page. It contains all the variables that you likely need.

Log in to reply