diff options
author | Michael Stürmer <michael.stuermer@schaeffler.com> | 2017-06-17 07:32:19 (GMT) |
---|---|---|
committer | Michael Stürmer <michael.stuermer@schaeffler.com> | 2017-06-22 19:39:37 (GMT) |
commit | dcdab5cf23b3777761d6c6dcaf0dfcefdd821792 (patch) | |
tree | 9560936f2e56180c7f0cdfb92263e3b6ae52eff9 /Source/cmVisualStudio10TargetGenerator.cxx | |
parent | 0a8f469af921d64431ed237022a02d39cac3ebb5 (diff) | |
download | CMake-dcdab5cf23b3777761d6c6dcaf0dfcefdd821792.zip CMake-dcdab5cf23b3777761d6c6dcaf0dfcefdd821792.tar.gz CMake-dcdab5cf23b3777761d6c6dcaf0dfcefdd821792.tar.bz2 |
Vs: factor out computation of <Link> tag for CSharp source files
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index d163ddb..9612c90 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -2056,14 +2056,10 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( typedef std::map<std::string, std::string> CsPropMap; CsPropMap sourceFileTags; // set <Link> tag if necessary - if (!this->InSourceBuild) { - const std::string stripFromPath = - this->Makefile->GetCurrentSourceDirectory(); - if (f.find(stripFromPath) != std::string::npos) { - std::string link = f.substr(stripFromPath.length() + 1); - this->ConvertToWindowsSlash(link); - sourceFileTags["Link"] = link; - } + std::string link; + this->GetCSharpSourceLink(source, link); + if (!link.empty()) { + sourceFileTags["Link"] = link; } this->GetCSharpSourceProperties(&sf, sourceFileTags); // write source file specific tags @@ -4380,6 +4376,23 @@ void cmVisualStudio10TargetGenerator::WriteCSharpSourceProperties( } } +void cmVisualStudio10TargetGenerator::GetCSharpSourceLink( + cmSourceFile const* sf, std::string& link) +{ + std::string f = sf->GetFullPath(); + if (!this->InSourceBuild) { + const std::string stripFromPath = + this->Makefile->GetCurrentSourceDirectory(); + if (f.find(stripFromPath) != std::string::npos) { + link = f.substr(stripFromPath.length() + 1); + if (const char* l = sf->GetProperty("VS_CSHARP_Link")) { + link = l; + } + this->ConvertToWindowsSlash(link); + } + } +} + std::string cmVisualStudio10TargetGenerator::GetCMakeFilePath( const char* relativeFilePath) const { |