[CMake] headers and recompile

Bill Hoffman bill.hoffman at kitware.com
Fri Apr 27 09:42:20 EDT 2007


Duncan Mac-Vicar Prett wrote:
> My .cpp files are not recompiled when I modify the headers, so if I just touch 
> a header, make does nothing.
>
> Do I need to include all headers in the source list, or there is a nicer way 
> to inject a dependency?
>
> Cheers
>
>   
That should work.  In CMakeFiles/target.dir/depend.make where target is 
the name of a library or executable in your project, you should see the 
source level depends that cmake computes for your project.  Perhaps the 
-I or include_directories are not set up so that cmake can find the 
header files, or they are being included in some way that is confusing 
cmake.  If you could create a small example that would help.

-Bill


More information about the CMake mailing list