0

Can I somehow override define QMAKE_CXX globally for all subprojects of a .pro file?

Placing this statement to the top project file did not change the compiler in subprojects. It only works if I copy it to every .pro file.

I would like to define QMAKE_CXX = ccache $$QMAKE_CXX using a command line argument for qmake

feedc0de
  • 3,646
  • 8
  • 30
  • 55
  • I'd strongly advise to either create a custom mkspec, or, in the case of ccache, to properly set it up so that it's found when invoking `gcc` or `g++` or `clang++` and so on. Anyhow, a simple workaround could be adding that line into a `.qmake.cache` file in the top level of your project. https://doc.qt.io/qt-5/qmake-environment-reference.html#cache-file – peppe Mar 26 '18 at 16:41
  • I just found out that Qt already does what I want by calling `qmake CONFIG+=ccache ../project`. I have no idea why that config switch exists. – feedc0de Mar 27 '18 at 09:21

0 Answers0