When qmake generates a make file, I think that it must specify which files depend on others, so that the compiler knows which source files need to be recompiled.

For example, suppose I have

Qt Code:
  1. HEADERS = foo.h bar.h
  2. SOURCES = foo.cpp
To copy to clipboard, switch view to plain text mode 

and in foo.cpp, I have

Qt Code:
  1. #include "foo.h"
  2. #include "bar.h"
  3. ...
To copy to clipboard, switch view to plain text mode 

If bar.h is modified, then foo.cpp is recompiled upon make.

Here's my question. What if I don't want bar.h to appear in the HEADERS variable? Then foo.cpp will not be recompiled when bar.h is modified . Is there a way for me to tell qmake to please look at bar.h --- but don't run moc on it?