[CMake] Generator-independent incremental CMake run

Nagger nagger at gmx.de
Thu Aug 14 11:26:39 EDT 2014


Am 14.08.2014 16:31, schrieb David Cole:
>> 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
>
> This is the problem.
>
> "cmake %builddir%" should be as fast as possible for a no-op... If it's
> not, it would be good to solve the real underlying problem that causes
> it to take 5 minutes for "nothing" rather than write elaborate scripts
> to try to workaround it.

I already had a look into our large generation time. They are multiple 
reasons, not one big issue which can be solved easily.


But with all due respect, its not just a 'workaround'. I do not want to 
re-compile things that haven't changed, so i also do not want to 
re-generate if nothing has changed.

A ZERO_CHECK (comparing timestamps of all used CMakeLists.txt) will 
always be faster than generating the project.


Test with CMake 3.0.1 configuring CMake itself:

   $ git describe
   v3.0.1-1690-geb3b550

   $ cmake --version
   cmake version 3.0.1

   CMake suite maintained and supported by Kitware (kitware.com/cmake).

   $ time cmake build
   -- Configuring done
   -- Generating done
   -- Build files have been written to: D:/Playground/cmake/cmake/build

   real    0m14.414s
   user    0m0.000s
   sys     0m0.015s

   $ time cmake --build build --target ZERO_CHECK
   Microsoft (R) Build Engine version 4.0.30319.17929
   [....]

   real    0m0.421s
   user    0m0.000s
   sys     0m0.015s


So ZERO_CHECK is 34 times faster. Why shouldn't I take advantage of that.


Thank,
Marc



More information about the CMake mailing list