How does CMake manage it automatically?
In my above example, if time_cx.h have been modified, how can we make sure that the next time I run “make all” (without running CMake again), only time_cx.c is compiled (to obj file), and then linking to produce the final binary file?
Do you have an simple example?
Thank you,
s.q
I don’t know exactly how the cmake makefile generator sets this up but typically it would make use of the compiler’s extra options to generate make dependency files.
I don’t know if cmake makefiles use exactly that method (probably not because they don’t use GNU make-specific features, IIRC) but they likely use something similar.
I’m sure there is a lot of nasty details I am not aware of about this but basically it’ll scan for included files in order to track down the dependencies.