diff options
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 69 |
1 files changed, 33 insertions, 36 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 946a020..dc74374 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -101,7 +101,7 @@ void cmLocalGenerator::Configure() static_cast<void>(clg); // make sure the CMakeFiles dir is there - std::string filesDir = this->Makefile->GetStartOutputDirectory(); + std::string filesDir = this->Makefile->GetCurrentBinaryDirectory(); filesDir += cmake::GetCMakeFilesDirectory(); cmSystemTools::MakeDirectory(filesDir.c_str()); @@ -177,7 +177,7 @@ void cmLocalGenerator::ComputeObjectMaxPath() void cmLocalGenerator::ReadInputFile() { // Look for the CMakeLists.txt file. - std::string currentStart = this->Makefile->GetStartDirectory(); + std::string currentStart = this->Makefile->GetCurrentSourceDirectory(); currentStart += "/CMakeLists.txt"; if(cmSystemTools::FileExists(currentStart.c_str(), true)) { @@ -194,7 +194,7 @@ void cmLocalGenerator::ReadInputFile() cmMakefile* mf = this->Parent->GetMakefile(); std::ostringstream e; e << "The source directory\n" - << " " << this->Makefile->GetStartDirectory() << "\n" + << " " << this->Makefile->GetCurrentSourceDirectory() << "\n" << "does not contain a CMakeLists.txt file."; switch (mf->GetPolicyStatus(cmPolicies::CMP0014)) { @@ -230,7 +230,8 @@ void cmLocalGenerator::SetupPathConversions() cmSystemTools::CollapseFullPath(this->Makefile->GetHomeDirectory()); cmSystemTools::SplitPath(outdir, this->HomeDirectoryComponents); outdir = - cmSystemTools::CollapseFullPath(this->Makefile->GetStartDirectory()); + cmSystemTools::CollapseFullPath( + this->Makefile->GetCurrentSourceDirectory()); cmSystemTools::SplitPath(outdir, this->StartDirectoryComponents); outdir = cmSystemTools::CollapseFullPath @@ -239,7 +240,7 @@ void cmLocalGenerator::SetupPathConversions() this->HomeOutputDirectoryComponents); outdir = cmSystemTools::CollapseFullPath - (this->Makefile->GetStartOutputDirectory()); + (this->Makefile->GetCurrentBinaryDirectory()); cmSystemTools::SplitPath(outdir, this->StartOutputDirectoryComponents); } @@ -250,12 +251,6 @@ void cmLocalGenerator::SetGlobalGenerator(cmGlobalGenerator *gg) this->GlobalGenerator = gg; this->Makefile = new cmMakefile; this->Makefile->SetLocalGenerator(this); - - // setup the home directories - this->Makefile->SetHomeDirectory( - gg->GetCMakeInstance()->GetHomeDirectory()); - this->Makefile->SetHomeOutputDirectory( - gg->GetCMakeInstance()->GetHomeOutputDirectory()); } void cmLocalGenerator::ConfigureFinalPass() @@ -302,7 +297,7 @@ void cmLocalGenerator::GenerateTestFiles() const std::string& config = this->Makefile->GetConfigurations(configurationTypes, false); - std::string file = this->Makefile->GetStartOutputDirectory(); + std::string file = this->Makefile->GetCurrentBinaryDirectory(); file += "/"; file += "CTestTestfile.cmake"; @@ -311,9 +306,9 @@ void cmLocalGenerator::GenerateTestFiles() fout << "# CMake generated Testfile for " << std::endl << "# Source directory: " - << this->Makefile->GetStartDirectory() << std::endl + << this->Makefile->GetCurrentSourceDirectory() << std::endl << "# Build directory: " - << this->Makefile->GetStartOutputDirectory() << std::endl + << this->Makefile->GetCurrentBinaryDirectory() << std::endl << "# " << std::endl << "# This file includes the relevant testing commands " << "required for " << std::endl @@ -343,7 +338,7 @@ void cmLocalGenerator::GenerateTestFiles() // TODO: Use add_subdirectory instead? fout << "subdirs("; std::string outP = - this->Children[i]->GetMakefile()->GetStartOutputDirectory(); + this->Children[i]->GetMakefile()->GetCurrentBinaryDirectory(); fout << this->Convert(outP,START_OUTPUT); fout << ")" << std::endl; } @@ -427,9 +422,9 @@ void cmLocalGenerator::GenerateInstallRules() } // Create the install script file. - std::string file = this->Makefile->GetStartOutputDirectory(); + std::string file = this->Makefile->GetCurrentBinaryDirectory(); std::string homedir = this->Makefile->GetHomeOutputDirectory(); - std::string currdir = this->Makefile->GetCurrentOutputDirectory(); + std::string currdir = this->Makefile->GetCurrentBinaryDirectory(); cmSystemTools::ConvertToUnixSlashes(file); cmSystemTools::ConvertToUnixSlashes(homedir); cmSystemTools::ConvertToUnixSlashes(currdir); @@ -444,7 +439,8 @@ void cmLocalGenerator::GenerateInstallRules() // Write the header. fout << "# Install script for directory: " - << this->Makefile->GetCurrentDirectory() << std::endl << std::endl; + << this->Makefile->GetCurrentSourceDirectory() + << std::endl << std::endl; fout << "# Set the install prefix" << std::endl << "if(NOT DEFINED CMAKE_INSTALL_PREFIX)" << std::endl << " set(CMAKE_INSTALL_PREFIX \"" << prefix << "\")" << std::endl @@ -516,7 +512,7 @@ void cmLocalGenerator::GenerateInstallRules() { if(!(*ci)->GetMakefile()->GetPropertyAsBool("EXCLUDE_FROM_ALL")) { - std::string odir = (*ci)->GetMakefile()->GetStartOutputDirectory(); + std::string odir = (*ci)->GetMakefile()->GetCurrentBinaryDirectory(); cmSystemTools::ConvertToUnixSlashes(odir); fout << " include(\"" << odir << "/cmake_install.cmake\")" << std::endl; @@ -652,7 +648,7 @@ void cmLocalGenerator::AddCustomCommandToCreateObject(const char* ofname, source.GetFullPath(), commandLines, comment.c_str(), - this->Makefile->GetStartOutputDirectory() + this->Makefile->GetCurrentBinaryDirectory() ); } @@ -674,12 +670,12 @@ void cmLocalGenerator::AddBuildTargetRule(const std::string& llang, !sf->GetPropertyAsBool("EXTERNAL_OBJECT")) { std::string dir_max; - dir_max += this->Makefile->GetCurrentOutputDirectory(); + dir_max += this->Makefile->GetCurrentBinaryDirectory(); dir_max += "/"; std::string obj = this->GetObjectFileNameWithoutTarget(*sf, dir_max); if(!obj.empty()) { - std::string ofname = this->Makefile->GetCurrentOutputDirectory(); + std::string ofname = this->Makefile->GetCurrentBinaryDirectory(); ofname += "/"; ofname += obj; objVector.push_back(ofname); @@ -749,7 +745,7 @@ void cmLocalGenerator::AddBuildTargetRule(const std::string& llang, "", commandLines, comment.c_str(), - this->Makefile->GetStartOutputDirectory() + this->Makefile->GetCurrentBinaryDirectory() ); this->Makefile->GetSource(targetFullPath); target.Target->AddSource(targetFullPath); @@ -1553,18 +1549,19 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs, if(includeBinaryDir) { if(emitted.find( - this->Makefile->GetStartOutputDirectory()) == emitted.end()) + this->Makefile->GetCurrentBinaryDirectory()) == emitted.end()) { - dirs.push_back(this->Makefile->GetStartOutputDirectory()); - emitted.insert(this->Makefile->GetStartOutputDirectory()); + dirs.push_back(this->Makefile->GetCurrentBinaryDirectory()); + emitted.insert(this->Makefile->GetCurrentBinaryDirectory()); } } if(includeSourceDir) { - if(emitted.find(this->Makefile->GetStartDirectory()) == emitted.end()) + if(emitted.find( + this->Makefile->GetCurrentSourceDirectory()) == emitted.end()) { - dirs.push_back(this->Makefile->GetStartDirectory()); - emitted.insert(this->Makefile->GetStartDirectory()); + dirs.push_back(this->Makefile->GetCurrentSourceDirectory()); + emitted.insert(this->Makefile->GetCurrentSourceDirectory()); } } @@ -2165,7 +2162,7 @@ bool cmLocalGenerator::GetRealDependency(const std::string& inName, // Treat the name as relative to the source directory in which it // was given. - dep = this->Makefile->GetCurrentDirectory(); + dep = this->Makefile->GetCurrentSourceDirectory(); dep += "/"; dep += inName; return true; @@ -2719,9 +2716,9 @@ const char* cmLocalGenerator::GetRelativeRootPath(RelativeRoot relroot) switch (relroot) { case HOME: return this->Makefile->GetHomeDirectory(); - case START: return this->Makefile->GetStartDirectory(); + case START: return this->Makefile->GetCurrentSourceDirectory(); case HOME_OUTPUT: return this->Makefile->GetHomeOutputDirectory(); - case START_OUTPUT: return this->Makefile->GetStartOutputDirectory(); + case START_OUTPUT: return this->Makefile->GetCurrentBinaryDirectory(); default: break; } return 0; @@ -2849,14 +2846,14 @@ std::string cmLocalGenerator::FindRelativePathTopSource() { std::string parentTop = parent->FindRelativePathTopSource(); if(cmSystemTools::IsSubDirectory( - this->Makefile->GetStartDirectory(), parentTop)) + this->Makefile->GetCurrentSourceDirectory(), parentTop)) { return parentTop; } } // Otherwise this directory itself is the new top. - return this->Makefile->GetStartDirectory(); + return this->Makefile->GetCurrentSourceDirectory(); } //---------------------------------------------------------------------------- @@ -2869,14 +2866,14 @@ std::string cmLocalGenerator::FindRelativePathTopBinary() { std::string parentTop = parent->FindRelativePathTopBinary(); if(cmSystemTools::IsSubDirectory( - this->Makefile->GetStartOutputDirectory(), parentTop)) + this->Makefile->GetCurrentBinaryDirectory(), parentTop)) { return parentTop; } } // Otherwise this directory itself is the new top. - return this->Makefile->GetStartOutputDirectory(); + return this->Makefile->GetCurrentBinaryDirectory(); } //---------------------------------------------------------------------------- |