Hi,
I came across a problem with qmake and Makefile.

I have this kind of directory structure :
Qt Code:
  1. src/NameSpace1/builder.cpp
  2. src/NameSpace2/builder.cpp
To copy to clipboard, switch view to plain text mode 

Some statements :
  • There is many namespaces
  • Each namespace has its own directory
  • Each namespace is owned by a developper who is responsible for it
  • Developpers don't know what's in others' namepsaces


As you can see in the sample, some name collisions will happen. There is no problem at the C++ level, but during the compilation stage some targets will have the same name.
For instance:
Qt Code:
  1. $> qmake -project "DESTDIR = debug" -o MyApp.pro && qmake
  2. $> make
To copy to clipboard, switch view to plain text mode 
It will output all object files in debug/. Considering the first example, it will be two same targets "debug/builder.o".


Is there any easy solution to create the same directory structure for object files as the source files ?

It should be something like that:
Qt Code:
  1. debug/NameSpace1/builder.o
  2. debug/NameSpace2/builder.o
To copy to clipboard, switch view to plain text mode