summaryrefslogtreecommitdiffstats
path: root/Source/cmcmd.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-05-14 19:38:27 (GMT)
committerBrad King <brad.king@kitware.com>2021-05-17 14:04:01 (GMT)
commit8526756b61014f780348346ba5fdf0604a02d158 (patch)
tree875962cd6dd10ef90e65fc64cad8fdfef8dad5b5 /Source/cmcmd.cxx
parent013ec595c8d6971c568cff4f8e457d90a6e8be88 (diff)
downloadCMake-8526756b61014f780348346ba5fdf0604a02d158.zip
CMake-8526756b61014f780348346ba5fdf0604a02d158.tar.gz
CMake-8526756b61014f780348346ba5fdf0604a02d158.tar.bz2
cmOutputConverter: Adopt relative path conversion helpers
Move them up from cmLocalGenerator and out of cmStateDirectory.
Diffstat (limited to 'Source/cmcmd.cxx')
-rw-r--r--Source/cmcmd.cxx16
1 files changed, 12 insertions, 4 deletions
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 98946b6..727e412 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -1270,11 +1270,15 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args,
cmStateSnapshot snapshot = cm.GetCurrentSnapshot();
snapshot.GetDirectory().SetCurrentBinary(startOutDir);
snapshot.GetDirectory().SetCurrentSource(startDir);
- snapshot.GetDirectory().SetRelativePathTopSource(homeDir.c_str());
- snapshot.GetDirectory().SetRelativePathTopBinary(homeOutDir.c_str());
cmMakefile mf(cm.GetGlobalGenerator(), snapshot);
auto lgd = cm.GetGlobalGenerator()->CreateLocalGenerator(&mf);
+ // FIXME: With advanced add_subdirectory usage, these are
+ // not necessarily the same as the generator originally used.
+ // We should pass all these directories through an info file.
+ lgd->SetRelativePathTopSource(homeDir);
+ lgd->SetRelativePathTopBinary(homeOutDir);
+
// Actually scan dependencies.
return lgd->UpdateDependencies(depInfo, verbose, color) ? 0 : 2;
}
@@ -1551,11 +1555,15 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args,
cmStateSnapshot snapshot = cm.GetCurrentSnapshot();
snapshot.GetDirectory().SetCurrentBinary(startOutDir);
snapshot.GetDirectory().SetCurrentSource(startDir);
- snapshot.GetDirectory().SetRelativePathTopSource(homeDir.c_str());
- snapshot.GetDirectory().SetRelativePathTopBinary(homeOutDir.c_str());
cmMakefile mf(cm.GetGlobalGenerator(), snapshot);
auto lgd = cm.GetGlobalGenerator()->CreateLocalGenerator(&mf);
+ // FIXME: With advanced add_subdirectory usage, these are
+ // not necessarily the same as the generator originally used.
+ // We should pass all these directories through an info file.
+ lgd->SetRelativePathTopSource(homeDir);
+ lgd->SetRelativePathTopBinary(homeOutDir);
+
return cmTransformDepfile(format, *lgd, args[8], args[9]) ? 0 : 2;
}
return 1;