Browse Source

cmake: Initialize Home directories on cmake for find-package mode.

The Home directories can be used to initialize cmMakefile directories
internally.
Stephen Kelly 10 years ago
parent
commit
8878bea7b6
1 changed files with 5 additions and 4 deletions
  1. 5 4
      Source/cmake.cxx

+ 5 - 4
Source/cmake.cxx

@@ -405,6 +405,11 @@ void cmake::ReadListFile(const std::vector<std::string>& args,
 
 
 bool cmake::FindPackage(const std::vector<std::string>& args)
 bool cmake::FindPackage(const std::vector<std::string>& args)
 {
 {
+  this->SetHomeDirectory
+    (cmSystemTools::GetCurrentWorkingDirectory());
+  this->SetHomeOutputDirectory
+    (cmSystemTools::GetCurrentWorkingDirectory());
+
   // if a generator was not yet created, temporarily create one
   // if a generator was not yet created, temporarily create one
   cmGlobalGenerator *gg = new cmGlobalGenerator;
   cmGlobalGenerator *gg = new cmGlobalGenerator;
   gg->SetCMakeInstance(this);
   gg->SetCMakeInstance(this);
@@ -413,12 +418,8 @@ bool cmake::FindPackage(const std::vector<std::string>& args)
   // read in the list file to fill the cache
   // read in the list file to fill the cache
   cmsys::auto_ptr<cmLocalGenerator> lg(gg->CreateLocalGenerator());
   cmsys::auto_ptr<cmLocalGenerator> lg(gg->CreateLocalGenerator());
   cmMakefile* mf = lg->GetMakefile();
   cmMakefile* mf = lg->GetMakefile();
-  mf->SetHomeOutputDirectory
-    (cmSystemTools::GetCurrentWorkingDirectory());
   mf->SetStartOutputDirectory
   mf->SetStartOutputDirectory
     (cmSystemTools::GetCurrentWorkingDirectory());
     (cmSystemTools::GetCurrentWorkingDirectory());
-  mf->SetHomeDirectory
-    (cmSystemTools::GetCurrentWorkingDirectory());
   mf->SetStartDirectory
   mf->SetStartDirectory
     (cmSystemTools::GetCurrentWorkingDirectory());
     (cmSystemTools::GetCurrentWorkingDirectory());