diff options
author | Brad King <brad.king@kitware.com> | 2018-07-09 11:33:28 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-07-09 11:33:35 (GMT) |
commit | ed75309344efe28eeb931fd537853ed8030db0a1 (patch) | |
tree | c1ae4b8405a7d0ffefeb571790df03c456b44859 /Source | |
parent | 0100e5b2a73deedc4c82ad1925a2ab39d5d63960 (diff) | |
parent | 8a6107650e60b0ca2b9dfdad4b86d1b2f57bbfd7 (diff) | |
download | CMake-ed75309344efe28eeb931fd537853ed8030db0a1.zip CMake-ed75309344efe28eeb931fd537853ed8030db0a1.tar.gz CMake-ed75309344efe28eeb931fd537853ed8030db0a1.tar.bz2 |
Merge topic 'csharp-link-file'
8a6107650e VS: Only link cs files when they're not in binary dir
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Michael Stürmer <michael.stuermer@schaeffler.com>
Merge-request: !2177
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 129abdf..41567a3 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -4565,14 +4565,17 @@ void cmVisualStudio10TargetGenerator::WriteCSharpSourceProperties( void cmVisualStudio10TargetGenerator::GetCSharpSourceLink( cmSourceFile const* sf, std::string& link) { - std::string f = sf->GetFullPath(); - if (!this->InSourceBuild) { + std::string const& sourceFilePath = sf->GetFullPath(); + std::string const& binaryDir = LocalGenerator->GetCurrentBinaryDirectory(); + + if (!cmSystemTools::IsSubDirectory(sourceFilePath, binaryDir)) { const std::string stripFromPath = this->Makefile->GetCurrentSourceDirectory(); - if (f.find(stripFromPath) != std::string::npos) { - link = f.substr(stripFromPath.length() + 1); + if (sourceFilePath.find(stripFromPath) == 0) { if (const char* l = sf->GetProperty("VS_CSHARP_Link")) { link = l; + } else { + link = sourceFilePath.substr(stripFromPath.length() + 1); } ConvertToWindowsSlash(link); } |