ENH: Emit a little more information in the error message when the output file is not found during a core try compile.

This commit is contained in:
David Cole 2009-01-29 15:23:18 -05:00
parent 75fb6798ab
commit d74b75af09
1 changed files with 8 additions and 1 deletions

View File

@ -22,7 +22,6 @@
int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv) int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
{ {
this->BinaryDirectory = argv[1].c_str(); this->BinaryDirectory = argv[1].c_str();
this->OutputFile = ""; this->OutputFile = "";
// which signature were we called with ? // which signature were we called with ?
@ -305,6 +304,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
if (this->SrcFileSignature) if (this->SrcFileSignature)
{ {
this->FindOutputFile(targetName); this->FindOutputFile(targetName);
if ((res==0) && (copyFile.size())) if ((res==0) && (copyFile.size()))
{ {
if(!cmSystemTools::CopyFileAlways(this->OutputFile.c_str(), if(!cmSystemTools::CopyFileAlways(this->OutputFile.c_str(),
@ -314,6 +314,13 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
emsg << "Could not COPY_FILE.\n" emsg << "Could not COPY_FILE.\n"
<< " OutputFile: '" << this->OutputFile.c_str() << "'\n" << " OutputFile: '" << this->OutputFile.c_str() << "'\n"
<< " copyFile: '" << copyFile.c_str() << "'\n"; << " copyFile: '" << copyFile.c_str() << "'\n";
if (this->FindErrorMessage.size())
{
emsg << "\n";
emsg << this->FindErrorMessage.c_str() << "\n";
}
cmSystemTools::Error(emsg.str().c_str()); cmSystemTools::Error(emsg.str().c_str());
return -1; return -1;
} }