[CMake] add_custom_command: regenerate all on modifcation?

Dave Milter davemilter at gmail.com
Sat May 31 18:24:59 EDT 2008


On 6/1/08, Alan W. Irwin <irwin at beluga.phys.uvic.ca> wrote:
> On 2008-05-31 12:55+0400 Dave Milter wrote:
>
>
> > Sorry, I completely not understand you, I don't see why I need test
> > source file dependencies, I want test what I test: cmake files
> > changes.
> >
>
>  In that case, my guess is CMake is taking the conservative approach, i.e.,
>  rebuilding everything when CMake files are changed.  I doubt very much that
>  CMake currently has the intelligence to recognize changes in source file
>  lists as a special case where only a partial rebuild should be done.
>

I tried, I used cmake version 2.7-20080521,
I create project from
main.cpp: int main() { return 0; }
foo1.cpp: class Foo1 {};

build it,
after that add file
foo2.cpp: class Foo2 {};

build it, and only foo2.o was build, so yes, CMake is smart enough,
but only for known rules, and when I play with add_custom_command
things becomes very bad.

>  For really big projects like KDE, I can see why you would like this
>  functionality. Perhaps the CMake developers should weigh in here on the
>  difficulties (which I suspect are large) of implementing this?
>
My project is not as big as KDE, but I have to wait five minutes,
after I add new file :(

>  You might want to try FILE(GLOB ...) to assemble your list of source files,
>  but I suspect there are going to be build dependency issues for that case
> as
>  well.
>

I look at generated by cmake makefiles, and all generated files depend on
CMakeLists.txt


More information about the CMake mailing list