[CMake] headers and recompile

Bill Hoffman bill.hoffman at kitware.com
Fri Apr 27 10:14:33 EDT 2007


Mathieu Malaterre wrote:
> On 4/27/07, Bill Hoffman <bill.hoffman at kitware.com> wrote:
>> 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.
>
> Isn't it a matter of simply adding the proper regular expression:
>
> INCLUDE_REGULAR_EXPRESSION
By default it finds all header files.  BTW, what version of cmake are 
you using?

-Bill



More information about the CMake mailing list