summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index b752c41..1e6624e 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -4695,10 +4695,12 @@ std::string cmGlobalXCodeGenerator::ConvertToRelativeForMake(
std::string cmGlobalXCodeGenerator::RelativeToSource(const std::string& p)
{
- // We force conversion because Xcode breakpoints do not work unless
- // they are in a file named relative to the source tree.
- return cmSystemTools::ForceToRelativePath(
- this->CurrentRootGenerator->GetCurrentSourceDirectory(), p);
+ std::string const& rootSrc =
+ this->CurrentRootGenerator->GetCurrentSourceDirectory();
+ if (cmSystemTools::IsSubDirectory(p, rootSrc)) {
+ return cmSystemTools::ForceToRelativePath(rootSrc, p);
+ }
+ return p;
}
std::string cmGlobalXCodeGenerator::RelativeToBinary(const std::string& p)