diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.cxx | 18 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.h | 4 | ||||
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 3 |
3 files changed, 24 insertions, 1 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; +} diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index 750b89c..e2cc14e 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -75,6 +75,10 @@ public: virtual const char* GetCMakeCFGIntDir() const { return "$(Configuration)";} bool Find64BitTools(cmMakefile* mf); + + /** Generate an <output>.rule file path for a given command output. */ + virtual std::string GenerateRuleFile(std::string const& output) const; + protected: virtual const char* GetIDEVersion() { return "10.0"; } diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 5921530..9c25b0c 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -459,7 +459,8 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile* source, command) { std::string sourcePath = source->GetFullPath(); - // the rule file seems to need to exist for vs10 + // VS 10 will always rebuild a custom command attached to a .rule + // file that doesn't exist so create the file explicitly. if (source->GetPropertyAsBool("__CMAKE_RULE")) { if(!cmSystemTools::FileExists(sourcePath.c_str())) |