title: building a Qt application outside the Qt sourcetree
body: <p>I made a simple Qt application that's based on an Qt example application and builds fine from within the "<em>examples</em>" directory of the Qt sourcetree.</p>
  
  <p>Now I want to move my project files to a different location but qmake fails to create a Makefile that can find the Qt header files. </p>
  
  <p>The project files have been moved from <code>~/qt-everywhere-opensource-src-4.7.2/examples/webkit/fullscreenbrowser</code> to  <code>~/cvswork/fullscreenbrowser/</code></p>
  
  <p>So the <strong>.pro</strong> file is now <code>~/cvswork/fullscreenbrowser/fullscreenbrowser.pro</code></p>
  
  <p>And the Qt sources are still at <code>~/qt-everywhere-opensource-src-4.7.2</code></p>
  
  <p><code>qmake</code> itself runs fine, but <code>make</code> fails to load some includes:</p>
  
  <pre><code>$ make
  g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_WEBKIT_LIB 
  -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB 
  -I/usr/share/qt4/mkspecs/linux-g++ 
  -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork 
  -I/usr/include/qt4/QtGui 
  -I/usr/include/qt4/QtWebKit 
  -I/usr/include/qt4 
  -I. 
  -o main.o main.cpp
  main.cpp:41:17: error: QtGui: No such file or directory
  </code></pre>
  
  <p>For comparison, when building under the <em>...examples...</em> directory, the first <code>g++</code> call is much different:</p>
  
  <pre><code>$ make
  g++ -c -pipe -fno-exceptions -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG 
  -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_HAVE_MMX 
  -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_HAVE_SSE3 
  -DQT_HAVE_SSSE3 -DQT_HAVE_SSE4_1 -DQT_HAVE_SSE4_2 -DQT_HAVE_AVX -DQT_SHARED 
  -I../../../mkspecs/qws/linux-x86-g++ 
  -I. 
  -I../../../include/QtCore 
  -I../../../include/QtNetwork 
  -I../../../include/QtGui 
  -I../../../include/QtWebKit 
  -I../../../include 
  -I.moc/release-shared-emb-x86 
  -o .obj/release-shared-emb-x86/main.o main.cpp
  </code></pre>
  
  <p>What do i have to configure so that the Qt source directory is found?</p>
  
  <hr>
  
  <p><strong>EDIT:</strong> The <code>fullscreenbrowser.pro</code> file can be seen here: <a href="http://pastebin.com/jUPJiWBC" rel="nofollow">http://pastebin.com/jUPJiWBC</a></p>
  
  <p><strong>EDIT2:</strong> I get the same behavior in the examples directory when adding <code>-nocache</code> to the <code>qmake</code> call.</p>