summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-05-12 19:42:14 (GMT)
committerBrad King <brad.king@kitware.com>2021-05-12 19:43:58 (GMT)
commitf69079577a50ab203b6355a22a2e2243f5480628 (patch)
tree17be2185360006379b8198305666b363c8345e68 /Source/cmGlobalXCodeGenerator.cxx
parent169d998bb8cb43e4f7793381fbd79781ffb1548e (diff)
downloadCMake-f69079577a50ab203b6355a22a2e2243f5480628.zip
CMake-f69079577a50ab203b6355a22a2e2243f5480628.tar.gz
CMake-f69079577a50ab203b6355a22a2e2243f5480628.tar.bz2
cmGlobalXCodeGenerator: Simplify relative path conversion under project root
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx14
1 files changed, 4 insertions, 10 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index f753f77..dd0ddf5 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -586,13 +586,7 @@ void cmGlobalXCodeGenerator::SetGenerationRoot(cmLocalGenerator* root)
{
this->CurrentProject = root->GetProjectName();
this->SetCurrentLocalGenerator(root);
- cmSystemTools::SplitPath(
- this->CurrentLocalGenerator->GetCurrentSourceDirectory(),
- this->ProjectSourceDirectoryComponents);
- cmSystemTools::SplitPath(
- this->CurrentLocalGenerator->GetCurrentBinaryDirectory(),
- this->ProjectOutputDirectoryComponents);
-
+ this->CurrentRootGenerator = root;
this->CurrentXCodeHackMakefile =
cmStrCat(root->GetCurrentBinaryDirectory(), "/CMakeScripts");
cmSystemTools::MakeDirectory(this->CurrentXCodeHackMakefile);
@@ -4704,13 +4698,13 @@ 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(
- cmSystemTools::JoinPath(this->ProjectSourceDirectoryComponents), p);
+ this->CurrentRootGenerator->GetCurrentSourceDirectory(), p);
}
std::string cmGlobalXCodeGenerator::RelativeToBinary(const std::string& p)
{
- return this->CurrentLocalGenerator->MaybeConvertToRelativePath(
- cmSystemTools::JoinPath(this->ProjectOutputDirectoryComponents), p);
+ return this->CurrentRootGenerator->MaybeConvertToRelativePath(
+ this->CurrentRootGenerator->GetCurrentBinaryDirectory(), p);
}
std::string cmGlobalXCodeGenerator::XCodeEscapePath(const std::string& p)