summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudio10Generator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2012-04-18 19:50:49 (GMT)
committerBrad King <brad.king@kitware.com>2012-04-18 19:54:35 (GMT)
commit72333a464870155d040e215bec37a7a31070f875 (patch)
tree7dac9ebfc5b46a5f22fc70664965db49e0481d59 /Source/cmGlobalVisualStudio10Generator.cxx
parent369e3464beb8258ce5b2af8bcbe6b476fca379de (diff)
downloadCMake-72333a464870155d040e215bec37a7a31070f875.zip
CMake-72333a464870155d040e215bec37a7a31070f875.tar.gz
CMake-72333a464870155d040e215bec37a7a31070f875.tar.bz2
VS10: Avoid creating .rule files next to outputs (#13141)
Hide custom command .rule files inside the CMakeFiles directory. Ensure a short, deterministic, and unique name by using a hash of the directory path containing the output file. Preserve the file name so the entry in the IDE is human-readable. Clarify the comment that explains why the rule file must be created on disk.
Diffstat (limited to 'Source/cmGlobalVisualStudio10Generator.cxx')
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 22ead10..28d738a 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -212,3 +212,21 @@ bool cmGlobalVisualStudio10Generator::Find64BitTools(cmMakefile* mf)
return false;
}
}
+
+//----------------------------------------------------------------------------
+std::string
+cmGlobalVisualStudio10Generator
+::GenerateRuleFile(std::string const& output) const
+{
+ // The VS 10 generator needs to create the .rule files on disk.
+ // Hide them away under the CMakeFiles directory.
+ std::string ruleDir = this->GetCMakeInstance()->GetHomeOutputDirectory();
+ ruleDir += cmake::GetCMakeFilesDirectory();
+ ruleDir += "/";
+ ruleDir += cmSystemTools::ComputeStringMD5(
+ cmSystemTools::GetFilenamePath(output).c_str());
+ std::string ruleFile = ruleDir + "/";
+ ruleFile += cmSystemTools::GetFilenameName(output);
+ ruleFile += ".rule";
+ return ruleFile;
+}