[CMake] Force rebuild

Eric Noulard eric.noulard at gmail.com
Mon Mar 26 08:56:17 EST 2007


2007/3/26, Bill Hoffman <bill.hoffman at kitware.com>:
> Philip Lowman wrote:
> > Min Cu wrote:
> >> I have a project which needs to be rebuild every time make is called
> >> (whether the project has changed or not). How do I do it?

[...]

> Well, I suppose you could do something like this.....
>
> Write a program that generates a header file that all files in your
> project include.   Then create a custom target that creates the header
> file, and have all other targets depend on that custom target.  Then
> make the custom target run ever build and have it always generate the
> header file.

I see an alternative.
If you really want to rebuild all your project
each time you build
you may afford to relaunch
CMake each time too don't you?

so
1) Do out-of-source build
2) Each time you want to build again
     2a) delete your build tree
     2b) re-create root build dir
     2c) launch cmake then make in your pristine build tree.


-- 
Erk


More information about the CMake mailing list