I don't like the default pro file. The objects will be in release/debug in windows, but in linux they are in the same dir of source files. With my method, the objects will be output into .obj/_win32 in windows, .obj/_linux in linux and .obj/_linux_arm and so on. Moc generated files will be in .moc/$[QT_VERSION](e.g. .moc/4.7.3), because they does not depends on platform, but the qt version.
here is config.pri
Qt Code:
  1. CONFIG += #ezx#static ezx
  2. CONFIG += profile
  3. #profiling, -pg is not supported for msvc
  4. debug:!*msvc*:profile {
  5. QMAKE_CXXFLAGS_DEBUG += -pg
  6. QMAKE_LFLAGS_DEBUG += -pg
  7. }
  8.  
  9. #$$[TARGET_PLATFORM]
  10. #$$[QT_ARCH] #windows symbian windowsce arm
  11. PLATFORM_EXT =
  12. ARCH_EXT =
  13. TOOLCHAIN_EXT =
  14. unix {
  15. PLATFORM_EXT = _unix
  16. *linux*: PLATFORM_EXT = _linux
  17. maemo*: PLATFORM_EXT = _maemo
  18. } else:win32 {
  19. PLATFORM_EXT = _win32
  20. } else:macx {
  21. PLATFORM_EXT = _macx
  22. }
  23.  
  24. ezx {
  25. QT_VERSION = 2.3.8
  26. CONFIG += qt warn_on release
  27. DEFINES += QT_THREAD_SUPPORT CONFIG_EZX
  28. PLATFORM_EXT = _ezx
  29. QMAKE_CXXFLAGS.ARMCC +=
  30. }
  31.  
  32. #*arm*: ARCH_EXT = $${ARCH_EXT}_arm
  33. #isEqual(QT_ARCH, arm) {
  34. contains(QT_ARCH, arm.*) {
  35. ARCH_EXT = $${ARCH_EXT}_$${QT_ARCH}
  36. }
  37. *64: ARCH_EXT = $${ARCH_EXT}_x64
  38.  
  39. *llvm*: TOOLCHAIN_EXT = _llvm
  40. #*msvc*:
  41.  
  42. DESTDIR = bin
  43. TARGET = $${TARGET}$${PLATFORM_EXT}$${ARCH_EXT}$${TOOLCHAIN_EXT}
  44. OBJECTS_DIR = .obj/$${PLATFORM_EXT}$${ARCH_EXT}$${TOOLCHAIN_EXT}
  45. #for Qt2, Qt3 which does not have QT_VERSION. Qt4: $$[QT_VERSION]
  46. MOC_DIR = .moc/$${QT_VERSION}
  47. RCC_DIR = .rcc/$${QT_VERSION}
  48. UI_DIR = .ui/$${QT_VERSION}
To copy to clipboard, switch view to plain text mode 

In a pro file, just write a few information and include config.pri, for example
Qt Code:
  1. TEMPLATE = app
  2. TARGET = hello
  3. INCLUDEPATH += src
  4. LIBS +=
  5. TRANSLATIONS+= i18n/hello_zh-cn.ts
  6. FORMS =
  7.  
  8. include(config.pri)
  9. HEADERS = hello.h
  10. SOURCES = hello.cpp
To copy to clipboard, switch view to plain text mode