diff options
author | Brad King <brad.king@kitware.com> | 2012-04-18 19:28:12 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-04-18 19:49:38 (GMT) |
commit | 369e3464beb8258ce5b2af8bcbe6b476fca379de (patch) | |
tree | 86ca6b0e9cb1f1b39462c50bd53df8398d457ed2 /Source/cmGlobalGenerator.cxx | |
parent | f9b758e91a9afa17123c5b81b5568ebbd52db598 (diff) | |
download | CMake-369e3464beb8258ce5b2af8bcbe6b476fca379de.zip CMake-369e3464beb8258ce5b2af8bcbe6b476fca379de.tar.gz CMake-369e3464beb8258ce5b2af8bcbe6b476fca379de.tar.bz2 |
Factor out custom command .rule file path generation
Add cmGlobalGenerator::GenerateRuleFile to compute a generator-specific
rule file location. This will allow specific generators to override the
location of .rule files without changing the behavior of other
generators.
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 545f9e8..b06cdb4 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -2092,6 +2092,21 @@ cmTarget cmGlobalGenerator::CreateGlobalTarget( } //---------------------------------------------------------------------------- +std::string +cmGlobalGenerator::GenerateRuleFile(std::string const& output) const +{ + std::string ruleFile = output; + ruleFile += ".rule"; + const char* dir = this->GetCMakeCFGIntDir(); + if(dir && dir[0] == '$') + { + cmSystemTools::ReplaceString(ruleFile, dir, + cmake::GetCMakeFilesDirectory()); + } + return ruleFile; +} + +//---------------------------------------------------------------------------- void cmGlobalGenerator::AppendDirectoryForConfig(const char*, const char*, const char*, std::string&) { |