summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2011-06-07 12:59:03 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2011-06-07 12:59:03 (GMT)
commit9d406cdb656740abcc03de8d655e57b4efe8c81b (patch)
treeb861b25fc2114fb0cd0babd33960c31eedf115c4 /Source
parent08b109a87f43406f70a125552a2e0aaf54d3b782 (diff)
downloadCMake-9d406cdb656740abcc03de8d655e57b4efe8c81b.zip
CMake-9d406cdb656740abcc03de8d655e57b4efe8c81b.tar.gz
CMake-9d406cdb656740abcc03de8d655e57b4efe8c81b.tar.bz2
Fix for bug #11927, external project git clone step always runs vs10.
In cmMakefile.cxx GetCMakeCFGInitDirectory is replaced with GetCMakeFilesDirectory for .rule files. In some cases with external projects, that directory will not exist. With vs10 the .rule files must exist or the rule will run with every build. This fix creates the path that the .rule file is in. In addition, it is now a CMake error if the .rule file can not be created.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 6d2338e..2a4ff92 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -351,6 +351,9 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile* source,
{
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());
if(fout)
{
@@ -358,6 +361,14 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile* source,
fout.flush();
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;