Merge topic 'fix_vs10_custom_command_rulefiles'

9d406cd Fix for bug #11927, external project git clone step always runs vs10.
This commit is contained in:
Brad King 2011-06-08 15:44:30 -04:00 committed by CMake Topic Stage
commit 45adc8e8c1

View File

@ -351,6 +351,9 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile* source,
{ {
if(!cmSystemTools::FileExists(sourcePath.c_str())) if(!cmSystemTools::FileExists(sourcePath.c_str()))
{ {
// Make sure the path exists for the file
std::string path = cmSystemTools::GetFilenamePath(sourcePath);
cmSystemTools::MakeDirectory(path.c_str());
std::ofstream fout(sourcePath.c_str()); std::ofstream fout(sourcePath.c_str());
if(fout) if(fout)
{ {
@ -358,6 +361,14 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile* source,
fout.flush(); fout.flush();
fout.close(); fout.close();
} }
else
{
std::string error = "Could not create file: [";
error += sourcePath;
error += "] ";
cmSystemTools::Error
(error.c_str(), cmSystemTools::GetLastSystemError().c_str());
}
} }
} }
cmLocalVisualStudio7Generator* lg = this->LocalGenerator; cmLocalVisualStudio7Generator* lg = this->LocalGenerator;