[cmake-developers] Automatic project generation with Visual Studio generators

Yves Frederix yves.frederix+cmake at gmail.com
Fri Sep 16 03:37:22 EDT 2016


Hi Brad,

> For `cmake --build` we already need to detect the generator used
> for the build tree in order to ask it to construct the appropriate
> command line.  For the VS generator we could directly run the same
> check that ZERO_CHECK would run in order to decide whether to regen
> the build files first.  That would avoid going through msbuild for
> this step altogether.

Thanks for your answer. So if I understand correctly, you would avoid
msbuild using msbuild for the up-to-date check and instead call
something like (taken from ZERO_CHECK.vcxproj):

  cmake -H... -B.. --check-stamp-list CMakeFiles/generate.stamp.list

This would work, but it would make all builds using 'cmake --build'
more verbose as before actually starting the msbuild-build, this would
always print an often large number of lines like:

  CMake does not need to re-run because .../CMakeFiles/generate.stamp
is up-to-date.

When using msbuild to build the zero_check target, you avoid this
somehow as you make use of the dependency tracking offered by msbuild.

I don't have a strong opinion on whether to use 'cmake -H -B...' or
msbuild, but I would like to avoid cluttering normal build output with
this information. Assuming we do not want to call msbuild, an option
would be to remove the print statement if a stamp file is up to date?
Or alternatively I could add an option '--verbose|-V' to cmake that
would control whether to print them?

Regards,
Yves


More information about the cmake-developers mailing list