Search code examples
qt4qmake

Force qmake to use C++11 without editing .pro file


I need to build a project using Qt4 and C++11. Is there a way to force qmake to generate a Makefile which uses C++11 without editing .pro file (by adding CONFIG += c++11)

Thanks


Solution

  • According to the official "Running qmake" documentation, you can simply pass qmake assignments on the command. In your case, it would be

    qmake "CONFIG+=C++11" <myfile>.pro