title: CXXFLAGS modification of Qt pro file?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2987062/configuring-the-gcc-compiler-switches-in-qt-qtcreator-and-qmake">Configuring the GCC compiler switches in Qt, QtCreator, and QMake</a>  </p>
  </blockquote>
  
  
  
  <p>I would like to use <code>-O1</code> instead of <code>-O2</code> in my makefile (<code>CFLAGS</code> and <code>CXXFLAGS</code>) for my Linux build. My understanding of how these makefiles are generated based on the .pro file is somewhat lacking. This is because the version of Qt combined with the version of G++ I am using has instabilities when <code>-O2</code> is present. </p>
  
  <p>Presently, I am running a replacement script, after I run qmake, which does this:</p>
  
  <pre><code>sed -i 's/\-O2/\-O1/g' AllProjects/Makefile.Release
  </code></pre>
  
  <p>This is a ghetto solution. A much better solution would be to modify the .pro file somehow to pass along these directives. I am not sure how <code>CFLAGS</code> and <code>CXXFLAGS</code> are being generated though.</p>
  
  <p>I have tried passing a </p>
  
  <pre><code>linux-g++-{ 
        CFLAGS += -O1
        CXXFLAGS += -O1
        CONFIG += -O1
  }
  </code></pre>
  
  <p>which did not work.</p>