disable cmake's verbose output in the Eclipse and KDevelop generators

The Eclipse and KDevelop generators set the VERBOSE environment variable to
TRUE in the project files, because they must be able to "see" the full
command lines and errors, otherwise they can't parse the errors. But the
VERBOSE env.var. also enables cmakes own verbose output, which can be quite
long. This commit introduces an environment variable CMAKE_NO_VERBOSE, which
when set disables cmake's verbose output also when VERBOSE is set. This
env.var is now set by both the Eclipse and the KDevelop generators.

Alex
This commit is contained in:
Alexander Neundorf 2009-12-23 13:51:46 -05:00
parent 8d88de4b4a
commit a1614caf37
3 changed files with 14 additions and 10 deletions

View File

@ -214,23 +214,22 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
fout <<
"\t\t\t\t<dictionary>\n"
"\t\t\t\t\t<key>org.eclipse.cdt.make.core.environment</key>\n"
"\t\t\t\t\t<value>VERBOSE=1|</value>\n" // enforce VERBOSE Makefile output
"\t\t\t\t\t<value>"
"\t\t\t\t\t<value>VERBOSE=1|CMAKE_NO_VERBOSE=1|" // enforce VERBOSE Makefile output
;
// set vsvars32.bat environment available at CMake time,
// but not necessarily when eclipse is open
if (make.find("nmake") != std::string::npos)
{
if (getenv("PATH"))
{
{
fout << "PATH=" << getenv("PATH") << "|";
}
}
if (getenv("INCLUDE"))
{
fout << "INCLUDE=" << getenv("INCLUDE") << "|";
}
if (getenv("LIB"))
{
{
fout << "LIB=" << getenv("LIB") << "|";
}
if (getenv("LIBPATH"))

View File

@ -475,6 +475,7 @@ void cmGlobalKdevelopGenerator
" <environments>\n"
" <default>\n"
" <envvar value=\"1\" name=\"VERBOSE\" />\n"
" <envvar value=\"1\" name=\"CMAKE_NO_VERBOSE\" />\n"
" </default>\n"
" </environments>\n"
" </make>\n";

View File

@ -1418,8 +1418,10 @@ int cmake::ExecuteCMakeCommand(std::vector<std::string>& args)
else if (args[1] == "cmake_depends" && args.size() >= 6)
{
// Use the make system's VERBOSE environment variable to enable
// verbose output.
bool verbose = cmSystemTools::GetEnv("VERBOSE") != 0;
// verbose output. This can be skipped by also setting CMAKE_NO_VERBOSE
// (which is set by the Eclipse and KDevelop generators).
bool verbose = ((cmSystemTools::GetEnv("VERBOSE") != 0)
&& (cmSystemTools::GetEnv("CMAKE_NO_VERBOSE") == 0));
// Create a cmake object instance to process dependencies.
cmake cm;
@ -2520,9 +2522,11 @@ int cmake::CheckBuildSystem()
{
// We do not need to rerun CMake. Check dependency integrity. Use
// the make system's VERBOSE environment variable to enable verbose
// output.
bool verbose = cmSystemTools::GetEnv("VERBOSE") != 0;
// output. This can be skipped by setting CMAKE_NO_VERBOSE (which is set
// by the Eclipse and KDevelop generators).
bool verbose = ((cmSystemTools::GetEnv("VERBOSE") != 0)
&& (cmSystemTools::GetEnv("CMAKE_NO_VERBOSE") == 0));
// This method will check the integrity of the build system if the
// option was given on the command line. It reads the given file to
// determine whether CMake should rerun.