[CMake] Generator-independent incremental CMake run

Nagger nagger at gmx.de
Thu Aug 14 10:02:26 EDT 2014


Am 14.08.2014 08:13, schrieb Hendrik Sattler:
> On 13. August 2014 21:40:34 MESZ, Nagger <nagger at gmx.de> wrote:
>> But what I really miss is an "--update" option for CMake which is doing
>>
>> all the work (updating if possible, configuring if necessary)
>> internally. It would use the implementation of 'cmake --build' to
>> trigger a re-configure and if that is not possible it would start a
>> fresh configure&generate.
>> Any thoughts about that?
>
> cmake $builddir
>
> does exactly that.

This does not work here. "cmake $builddir" does a full 
configure&generate. (CMake version is 2.8.12)

We have a fairly large project with about 400 targets.
  $ cmake %builddir%
  -> takes about 5 minutes for a No-op

  $ cmake --build %builddir% --target ZERO_CHECK
  -> takes 20 seconds for No-op



> The ZERO_CHECK visual studio target that is present in every cmake generated solution does this: it checks if cmake needs to be re-run. It is built before every other target. So your batch file does a lot of things that are already done by cmake.

If the build is started from command line (cmake --build  or msbuild 
directly) your wont get the "Project has changed! Abort and 
Reload?"-Dialog. The old solution will be build. You need to execute the 
build-process a seconds time. Or - as the script does - start a separate 
ZERO_CHECK before the actual build.


Marc



More information about the CMake mailing list