[CMake] configure_file without continuous re-build

Bill Hoffman bill.hoffman at kitware.com
Tue Jan 12 17:25:02 EST 2010


Daniel Blezek wrote:
> Hi Mike,
> 
>   Sorry, I guess I wasn't quite clear.  The re-builds occur when I touch any
> CMakeLists.txt file in the entire project.  Since we're under active
> development, new source files are being added fairly frequently.  I didn't
> want re-builds to trigger each time a developer adds a new class.
> 
>   I believe that configure_file() is re-run whenever CMake does a
> "Generate", not only when the .in file is modified.  On a normal build this
> isn't an issue, but is a problem for us.
> 
>   Putting the "NOT EXISTS" guard seems to solve the problem, but is a little
> ugly.
> 
configure_file will only write the file if it changes.   You must be 
changing the file each time cmake is run, which is bad....

-Bill


More information about the CMake mailing list