summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-07-09 18:35:49 (GMT)
committerBrad King <brad.king@kitware.com>2013-07-09 19:00:39 (GMT)
commit18e1bfbb3c2515b1b33d95f53e1dd7f10e3f54c4 (patch)
treecc1a2d7500a307af64a3dbbf2c185efde93a0b38 /Source
parent448a67714825a6d3018a6974153de6771080a8e6 (diff)
downloadCMake-18e1bfbb3c2515b1b33d95f53e1dd7f10e3f54c4.zip
CMake-18e1bfbb3c2515b1b33d95f53e1dd7f10e3f54c4.tar.gz
CMake-18e1bfbb3c2515b1b33d95f53e1dd7f10e3f54c4.tar.bz2
cmake: On configure error suggest looking at CMake*.log files
When CMake reports failure to configure a project, especially when the toolchain does not initialize properly, the true reason may be clear from reading the CMakeFiles/CMake(Output|Error).log files. Advise users to look at these files if they exist when configuration fails. Add RunCMake.Configure test to check that the log files are mentioned when configuration fails.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalGenerator.cxx22
1 files changed, 19 insertions, 3 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index ad74767..19b9110 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -892,12 +892,28 @@ void cmGlobalGenerator::Configure()
if ( this->CMakeInstance->GetWorkingMode() == cmake::NORMAL_MODE)
{
- const char* msg = "Configuring done";
+ cmOStringStream msg;
if(cmSystemTools::GetErrorOccuredFlag())
{
- msg = "Configuring incomplete, errors occurred!";
+ msg << "Configuring incomplete, errors occurred!";
+ const char* logs[] = {"CMakeOutput.log", "CMakeError.log", 0};
+ for(const char** log = logs; *log; ++log)
+ {
+ std::string f = this->CMakeInstance->GetHomeOutputDirectory();
+ f += this->CMakeInstance->GetCMakeFilesDirectory();
+ f += "/";
+ f += *log;
+ if(cmSystemTools::FileExists(f.c_str()))
+ {
+ msg << "\nSee also \"" << f << "\".";
+ }
+ }
+ }
+ else
+ {
+ msg << "Configuring done";
}
- this->CMakeInstance->UpdateProgress(msg, -1);
+ this->CMakeInstance->UpdateProgress(msg.str().c_str(), -1);
}
}