[CMake] CMake and it's invocation from MS VC7

Brad King brad.king at kitware.com
Tue May 16 14:39:46 EDT 2006


Steve Johns wrote:
> I think I don't understand something about CMake, though.  When I build 
> any of the 5 projects that were created (the 3 file directories, 
> ALL_BUILD, and INSTALL), the first thing that happens, according to the 
> build log, is that CMake is invoked.
> 
> Could someone kindly tell me why this happens, if it needs to happen, 
> what I can do about it, and comment in general about what role CMake 
> plays in the MS IDE after the solution/projects are created in the first 
> place?
> 
> My impression was that CMake created the native build environment (in 
> this case the MS solution/projects) where none existed before, and that 
> was the extent of it's job.  It seems to want to continue to be a 
> "player", and so there is clearly something I don't understand.

CMake takes responsibility both for generating projects and for keeping 
them up to date as sources (CMakeLists.txt code) change.  There are 
custom build rules in the project files to compare the time CMake last 
generated the project to the time of the CMake code specifying the 
project.  If the project is older than the input code then CMake 
regenerates the build system.

> I'm also constantly getting messages that my project has changed 
> "outside the IDE", and I wonder if /expect that CMake is causing this ...

This is what it is doing when it reruns during the build.

When things are working properly you should get this behavior only when 
CMakeLists.txt files are changed.  If you are getting it every time you 
build then something is wrong.  Make sure your sources are not dated in 
the future.

-Brad


More information about the CMake mailing list