| 6022 | } |
| 6023 | |
| 6024 | std::string cmVisualStudio10TargetGenerator::GetCSharpSourceLink( |
| 6025 | cmSourceFile const* source) |
| 6026 | { |
| 6027 | // For out of source files, we first check if a matching source group |
| 6028 | // for this file exists, otherwise we check if the path relative to current |
| 6029 | // source- or binary-dir is used within the link and return that. |
| 6030 | // In case of .cs files we can't do that automatically for files in the |
| 6031 | // binary directory, because this leads to compilation errors. |
| 6032 | std::string link; |
| 6033 | std::string sourceGroupedFile; |
| 6034 | std::string const& fullFileName = source->GetFullPath(); |
| 6035 | std::string const& srcDir = this->Makefile->GetCurrentSourceDirectory(); |
| 6036 | std::string const& binDir = this->Makefile->GetCurrentBinaryDirectory(); |
| 6037 | cmSourceGroup const* sourceGroup = |
| 6038 | this->LocalGenerator->FindSourceGroup(fullFileName); |
| 6039 | if (sourceGroup && !sourceGroup->GetFullName().empty()) { |
| 6040 | sourceGroupedFile = |
| 6041 | cmStrCat(sourceGroup->GetFullName(), '/', |
| 6042 | cmsys::SystemTools::GetFilenameName(fullFileName)); |
| 6043 | cmsys::SystemTools::ConvertToUnixSlashes(sourceGroupedFile); |
| 6044 | } |
| 6045 | |
| 6046 | if (!sourceGroupedFile.empty() && |
| 6047 | cmHasSuffix(fullFileName, sourceGroupedFile)) { |
| 6048 | link = sourceGroupedFile; |
| 6049 | } else if (cmHasPrefix(fullFileName, srcDir)) { |
| 6050 | link = fullFileName.substr(srcDir.length() + 1); |
| 6051 | } else if (!cmHasSuffix(fullFileName, ".cs") && |
| 6052 | cmHasPrefix(fullFileName, binDir)) { |
| 6053 | link = fullFileName.substr(binDir.length() + 1); |
| 6054 | } else if (cmValue l = source->GetProperty("VS_CSHARP_Link")) { |
| 6055 | link = *l; |
| 6056 | } |
| 6057 | |
| 6058 | ConvertToWindowsSlash(link); |
| 6059 | return link; |
| 6060 | } |
| 6061 | |
| 6062 | std::string cmVisualStudio10TargetGenerator::GetCMakeFilePath( |
| 6063 | char const* relativeFilePath) const |
no test coverage detected