Stop build log pollution due to messages about generate.stamp
When using CMake compiling C++ projects on Visual Studio, a significant portion of the build log is polluted with fairly useless information about the status of various generate.stamp
files.
Checking Build System
CMake does not need to re-run because C:/project_x/CMakeFiles/generate.stamp is up-to-date.
CMake does not need to re-run because C:/project_x/tests/CMakeFiles/generate.stamp is up-to-date.
Building Custom Rule C:/project_x/tests/CMakeLists.txt
CMake does not need to re-run because C:/project_x/tests/CMakeFiles/generate.stamp is up-to-date.
...
(This is particularly bad for nested projects that build a number of other dependencies that also use cmake. One of my projects produces over 100 such messages in a typical build.) These messages convey little useful information and distract from other more relevant log messages like warnings and errors.
The lines that cause this are in source/cmake.cxx
:
if (verbose) {
// Notify the user why CMake is not re-running. It is safe to
// just print to stdout here because this code is only reachable
// through an undocumented flag used by the VS generator.
std::cout << "CMake does not need to re-run because " << stampName
<< " is up-to-date.\n";
}
and verbose
is a parameter with default value equal to true
. There doesn't seem to be a way to reduce the verbosity at runtime -- for instance, set(CMAKE_VERBOSE_MAKEFILE OFF)
is ineffective.
I would like to propose that these message are either removed, or that CMake offers an optional way to disable them.