Set the current dirs on the snapshot before creating the cmMakefile.

The cmMakefile should get a fully prepared snapshot and not clobber its
definitions.  It should eventually be able to process list files from any
starting-point snapshot, though that is some refactoring away still.
This commit is contained in:
Stephen Kelly
2015-05-31 01:57:04 +02:00
parent f716460ed8
commit 360e4e1db0
7 changed files with 57 additions and 45 deletions
+4 -2
View File
@@ -769,11 +769,13 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
{
cm.SetGlobalGenerator(ggd);
cmState::Snapshot snapshot = cm.GetCurrentSnapshot();
snapshot.GetDirectory().SetCurrentBinary
(cmSystemTools::GetCurrentWorkingDirectory());
snapshot.GetDirectory().SetCurrentSource
(cmSystemTools::GetCurrentWorkingDirectory());
cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(ggd, snapshot));
cmsys::auto_ptr<cmLocalGenerator> lgd(
ggd->CreateLocalGenerator(mf.get()));
lgd->GetMakefile()->SetCurrentSourceDirectory(startDir);
lgd->GetMakefile()->SetCurrentBinaryDirectory(startOutDir);
// Actually scan dependencies.
return lgd->UpdateDependencies(depInfo.c_str(),