I want to organize my project in the following order:

projectname\
projectname.pro
common.pri

projectname\gui\
gui.pro
mainwindow.cpp
mainwindow.h
mainwindow.ui

projectname\aname\
aname.pro
h and cpp files only

projectname\test\
test.pro
main.cpp

projectname.pro:
Qt Code:
  1. TEMPLATE = subdirs
  2. SUBDIRS = gui \
  3. aname
  4. QT += core gui
  5. # main app
  6. CONFIG += ordered
  7. SUBDIRS += test
To copy to clipboard, switch view to plain text mode 

common.pri:
Qt Code:
  1. INCLUDEPATH += gui \
  2. aname
  3. WARNINGS += -Wall
  4. # The following keeps the generated files at least somewhat separate
  5. # from the source files.
  6. UI_DIR = uics
  7. MOC_DIR = mocs
  8. OBJECTS_DIR = objs
To copy to clipboard, switch view to plain text mode 

gui.pro:
Qt Code:
  1. ! include( ../common.pri ) {
  2. error( Couldn't find the common.pri file! )
  3. }
  4. QT += core gui
  5. FORMS += \
  6. mainwindow.ui
  7. SOURCES += \
  8. mainwindow.cpp
  9. HEADERS += \
  10. mainwindow.h \
  11. OBJECTS_DIR += projectname\gui\mainwindow.h
  12. QMAKE_EXT_OBJ += projectname\gui\mainwindow.h
  13. LIBS += -L../aname -laname
To copy to clipboard, switch view to plain text mode 


aname.pro:
Qt Code:
  1. ! include( ../common.pri ) {
  2. error( Couldn't find the common.pri file! )
  3. }
  4. QT += core gui
  5. SOURCES += \
  6. ...cpp
  7.  
  8. HEADERS += \
  9. ....h
  10.  
  11. OBJECTS_DIR += projectname/aname/....h \
  12.  
  13. QMAKE_EXT_OBJ = projectname/aname/....h \
  14. test.pro
  15. ! include( ../common.pri ) {
  16. error( Couldn't find the common.pri file! )
  17. }
  18. QT += core gui
  19. TARGET = test
  20. TEMPLATE = app
  21. SOURCES += \
  22. main.cpp \
  23. LIBS += -L../gui -lgui
To copy to clipboard, switch view to plain text mode 

I want my header and source located in the same folder, but I want the #include to be <projectname/amame/...h>. I have tried the OBJECTS_DIR and QMAKE_EXT_OBJ but it don't seem to find the header files. It can't find the header in #include <...h> current folder ether. The qtcreator auto completion seems to be a bit smarter since it finds the headers... hehe.
Can anyone see what I'm doing wrong and how I can get the #include <projectname/aname/..>