diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-04-16 19:17:41 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-04-20 22:12:52 (GMT) |
commit | 55d80d0a8557189400bc12c5e577702a4d03b2e6 (patch) | |
tree | f19e6c57f469cc0ded33f382b0bee47369265c13 | |
parent | b23cf06f861e928cf8ee942eabd24ea76e299f4f (diff) | |
download | CMake-55d80d0a8557189400bc12c5e577702a4d03b2e6.zip CMake-55d80d0a8557189400bc12c5e577702a4d03b2e6.tar.gz CMake-55d80d0a8557189400bc12c5e577702a4d03b2e6.tar.bz2 |
cmMakefile: Rename GetCurrent{,Source}Directory.
Match the names used in cmake code.
31 files changed, 65 insertions, 61 deletions
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 7f9825c..31c0171 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -346,7 +346,7 @@ void cmCTestScriptHandler::CreateCMake() this->CMake->SetProgressCallback(ctestScriptProgressCallback, this->CTest); // Set CMAKE_CURRENT_SOURCE_DIR and CMAKE_CURRENT_BINARY_DIR. - // Also, some commands need Makefile->GetCurrentDirectory(). + // Also, some commands need Makefile->GetCurrentSourceDirectory(). std::string cwd = cmSystemTools::GetCurrentWorkingDirectory(); this->Makefile->SetStartDirectory(cwd); this->Makefile->SetStartOutputDirectory(cwd); diff --git a/Source/cmAddSubDirectoryCommand.cxx b/Source/cmAddSubDirectoryCommand.cxx index 9d55c1a..bae76d2 100644 --- a/Source/cmAddSubDirectoryCommand.cxx +++ b/Source/cmAddSubDirectoryCommand.cxx @@ -57,7 +57,7 @@ bool cmAddSubDirectoryCommand::InitialPass } else { - srcPath = this->Makefile->GetCurrentDirectory(); + srcPath = this->Makefile->GetCurrentSourceDirectory(); srcPath += "/"; srcPath += srcArg; } @@ -79,12 +79,12 @@ bool cmAddSubDirectoryCommand::InitialPass // not a subdirectory of the current directory then it is an // error. if(!cmSystemTools::IsSubDirectory(srcPath, - this->Makefile->GetCurrentDirectory())) + this->Makefile->GetCurrentSourceDirectory())) { std::ostringstream e; e << "not given a binary directory but the given source directory " << "\"" << srcPath << "\" is not a subdirectory of \"" - << this->Makefile->GetCurrentDirectory() << "\". " + << this->Makefile->GetCurrentSourceDirectory() << "\". " << "When specifying an out-of-tree source a binary directory " << "must be explicitly specified."; this->SetError(e.str()); @@ -93,7 +93,7 @@ bool cmAddSubDirectoryCommand::InitialPass // Remove the CurrentDirectory from the srcPath and replace it // with the CurrentOutputDirectory. - const char* src = this->Makefile->GetCurrentDirectory(); + const char* src = this->Makefile->GetCurrentSourceDirectory(); const char* bin = this->Makefile->GetCurrentOutputDirectory(); size_t srcLen = strlen(src); size_t binLen = strlen(bin); diff --git a/Source/cmAuxSourceDirectoryCommand.cxx b/Source/cmAuxSourceDirectoryCommand.cxx index b8238f8..5f5017d 100644 --- a/Source/cmAuxSourceDirectoryCommand.cxx +++ b/Source/cmAuxSourceDirectoryCommand.cxx @@ -29,7 +29,7 @@ bool cmAuxSourceDirectoryCommand::InitialPass std::string tdir; if(!cmSystemTools::FileIsFullPath(templateDirectory.c_str())) { - tdir = this->Makefile->GetCurrentDirectory(); + tdir = this->Makefile->GetCurrentSourceDirectory(); tdir += "/"; tdir += templateDirectory; } diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx index 77cd6c6..d0d30b2 100644 --- a/Source/cmCPluginAPI.cxx +++ b/Source/cmCPluginAPI.cxx @@ -141,7 +141,7 @@ const char* CCONV cmGetStartOutputDirectory(void *arg) const char* CCONV cmGetCurrentDirectory(void *arg) { cmMakefile *mf = static_cast<cmMakefile *>(arg); - return mf->GetCurrentDirectory(); + return mf->GetCurrentSourceDirectory(); } const char* CCONV cmGetCurrentOutputDirectory(void *arg) { diff --git a/Source/cmConfigureFileCommand.cxx b/Source/cmConfigureFileCommand.cxx index 6876388..967d54d 100644 --- a/Source/cmConfigureFileCommand.cxx +++ b/Source/cmConfigureFileCommand.cxx @@ -26,7 +26,7 @@ bool cmConfigureFileCommand const char* inFile = args[0].c_str(); if(!cmSystemTools::FileIsFullPath(inFile)) { - this->InputFile = this->Makefile->GetCurrentDirectory(); + this->InputFile = this->Makefile->GetCurrentSourceDirectory(); this->InputFile += "/"; } this->InputFile += inFile; diff --git a/Source/cmExtraQbsGenerator.cxx b/Source/cmExtraQbsGenerator.cxx index 5a1f9ef..7e923a8 100644 --- a/Source/cmExtraQbsGenerator.cxx +++ b/Source/cmExtraQbsGenerator.cxx @@ -81,7 +81,7 @@ void cmExtraQbsGenerator::AppendSubProject(cmGeneratedFileStream &fout, } const std::string &relativePath = cmSystemTools::RelativePath( - mk->GetHomeDirectory(), mk->GetCurrentDirectory()); + mk->GetHomeDirectory(), mk->GetCurrentSourceDirectory()); fout << "\tProject {\n" << "\t\tname:\"" << relativePath << "\"\n"; this->AppendProduct(fout, lg); diff --git a/Source/cmFLTKWrapUICommand.cxx b/Source/cmFLTKWrapUICommand.cxx index 488beaa..5000fd2 100644 --- a/Source/cmFLTKWrapUICommand.cxx +++ b/Source/cmFLTKWrapUICommand.cxx @@ -24,7 +24,7 @@ bool cmFLTKWrapUICommand } // what is the current source dir - std::string cdir = this->Makefile->GetCurrentDirectory(); + std::string cdir = this->Makefile->GetCurrentSourceDirectory(); const char* fluid_exe = this->Makefile->GetRequiredDefinition("FLTK_FLUID_EXECUTABLE"); diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 6ac0def..a0ba885 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -227,7 +227,7 @@ bool cmFileCommand::HandleWriteCommand(std::vector<std::string> const& args, std::string fileName = *i; if ( !cmsys::SystemTools::FileIsFullPath(i->c_str()) ) { - fileName = this->Makefile->GetCurrentDirectory(); + fileName = this->Makefile->GetCurrentSourceDirectory(); fileName += "/" + *i; } @@ -309,7 +309,7 @@ bool cmFileCommand::HandleReadCommand(std::vector<std::string> const& args) std::string fileName = fileNameArg.GetString(); if ( !cmsys::SystemTools::FileIsFullPath(fileName.c_str()) ) { - fileName = this->Makefile->GetCurrentDirectory(); + fileName = this->Makefile->GetCurrentSourceDirectory(); fileName += "/" + fileNameArg.GetString(); } @@ -445,7 +445,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args) std::string fileName = args[1]; if(!cmsys::SystemTools::FileIsFullPath(fileName.c_str())) { - fileName = this->Makefile->GetCurrentDirectory(); + fileName = this->Makefile->GetCurrentSourceDirectory(); fileName += "/" + args[1]; } @@ -984,7 +984,7 @@ bool cmFileCommand::HandleGlobCommand(std::vector<std::string> const& args, cmsys::Glob::GlobMessages globMessages; if ( !cmsys::SystemTools::FileIsFullPath(i->c_str()) ) { - std::string expr = this->Makefile->GetCurrentDirectory(); + std::string expr = this->Makefile->GetCurrentSourceDirectory(); // Handle script mode if (!expr.empty()) { @@ -1091,7 +1091,7 @@ bool cmFileCommand::HandleMakeDirectoryCommand( const std::string* cdir = &(*i); if ( !cmsys::SystemTools::FileIsFullPath(i->c_str()) ) { - expr = this->Makefile->GetCurrentDirectory(); + expr = this->Makefile->GetCurrentSourceDirectory(); expr += "/" + *i; cdir = &expr; } @@ -1556,7 +1556,7 @@ bool cmFileCopier::CheckValue(std::string const& arg) } else { - std::string file = this->Makefile->GetCurrentDirectory(); + std::string file = this->Makefile->GetCurrentSourceDirectory(); file += "/" + arg; this->Files.push_back(file); } @@ -2658,13 +2658,13 @@ bool cmFileCommand::HandleRename(std::vector<std::string> const& args) std::string oldname = args[1]; if(!cmsys::SystemTools::FileIsFullPath(oldname.c_str())) { - oldname = this->Makefile->GetCurrentDirectory(); + oldname = this->Makefile->GetCurrentSourceDirectory(); oldname += "/" + args[1]; } std::string newname = args[2]; if(!cmsys::SystemTools::FileIsFullPath(newname.c_str())) { - newname = this->Makefile->GetCurrentDirectory(); + newname = this->Makefile->GetCurrentSourceDirectory(); newname += "/" + args[2]; } @@ -2698,7 +2698,7 @@ bool cmFileCommand::HandleRemove(std::vector<std::string> const& args, std::string fileName = *i; if(!cmsys::SystemTools::FileIsFullPath(fileName.c_str())) { - fileName = this->Makefile->GetCurrentDirectory(); + fileName = this->Makefile->GetCurrentSourceDirectory(); fileName += "/" + *i; } @@ -3743,7 +3743,7 @@ bool cmFileCommand::HandleLockCommand( if (!cmsys::SystemTools::FileIsFullPath(path)) { - path = this->Makefile->GetCurrentDirectory() + ("/" + path); + path = this->Makefile->GetCurrentSourceDirectory() + ("/" + path); } // Unify path (remove '//', '/../', ...) diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index aecd230..4d568e9 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -663,7 +663,7 @@ bool cmFindPackageCommand::HandlePackageMode() if(!cmSystemTools::FileIsFullPath(dir.c_str())) { dir = "/" + dir; - dir = this->Makefile->GetCurrentDirectory() + dir; + dir = this->Makefile->GetCurrentSourceDirectory() + dir; } // The file location was cached. Look for the correct file. std::string file; diff --git a/Source/cmGetFilenameComponentCommand.cxx b/Source/cmGetFilenameComponentCommand.cxx index 6947a7f..67f9f2d 100644 --- a/Source/cmGetFilenameComponentCommand.cxx +++ b/Source/cmGetFilenameComponentCommand.cxx @@ -97,7 +97,7 @@ bool cmGetFilenameComponentCommand // If the path given is relative evaluate it relative to the // current source directory. result = cmSystemTools::CollapseFullPath( - filename, this->Makefile->GetCurrentDirectory()); + filename, this->Makefile->GetCurrentSourceDirectory()); if(args[2] == "REALPATH") { // Resolve symlinks if possible diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx index 3e1d08e..00dbdd3 100644 --- a/Source/cmGetPropertyCommand.cxx +++ b/Source/cmGetPropertyCommand.cxx @@ -255,7 +255,7 @@ bool cmGetPropertyCommand::HandleDirectoryMode() std::string dir = this->Name; if(!cmSystemTools::FileIsFullPath(dir.c_str())) { - dir = this->Makefile->GetCurrentDirectory(); + dir = this->Makefile->GetCurrentSourceDirectory(); dir += "/"; dir += this->Name; } diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 786f8fa..c76c65d 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1567,7 +1567,8 @@ void cmGlobalGenerator::CheckLocalGenerators() text += "\n linked by target \""; text += l->second.GetName(); text += "\" in directory "; - text+=this->LocalGenerators[i]->GetMakefile()->GetCurrentDirectory(); + text+=this->LocalGenerators[i]->GetMakefile() + ->GetCurrentSourceDirectory(); notFoundMap[varName] = text; } } @@ -1597,7 +1598,7 @@ void cmGlobalGenerator::CheckLocalGenerators() std::string text = notFoundMap[varName]; text += "\n used as include directory in directory "; text += this->LocalGenerators[i] - ->GetMakefile()->GetCurrentDirectory(); + ->GetMakefile()->GetCurrentSourceDirectory(); notFoundMap[varName] = text; } } diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 8c37338..c8e7632 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -407,7 +407,7 @@ void cmGlobalXCodeGenerator::SetGenerationRoot(cmLocalGenerator* root) { this->CurrentProject = root->GetMakefile()->GetProjectName(); this->SetCurrentLocalGenerator(root); - cmSystemTools::SplitPath(this->CurrentMakefile->GetCurrentDirectory(), + cmSystemTools::SplitPath(this->CurrentMakefile->GetCurrentSourceDirectory(), this->ProjectSourceDirectoryComponents); cmSystemTools::SplitPath(this->CurrentMakefile->GetCurrentOutputDirectory(), this->ProjectOutputDirectoryComponents); @@ -3342,7 +3342,7 @@ bool cmGlobalXCodeGenerator // Point Xcode at the top of the source tree. { std::string pdir = - this->RelativeToBinary(root->GetMakefile()->GetCurrentDirectory()); + this->RelativeToBinary(root->GetMakefile()->GetCurrentSourceDirectory()); this->RootObject->AddAttribute("projectDirPath", this->CreateString(pdir.c_str())); this->RootObject->AddAttribute("projectRoot", this->CreateString("")); diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index 2d7d7cc..fac9641 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -163,7 +163,7 @@ bool cmInstallCommand::HandleScriptMode(std::vector<std::string> const& args) std::string script = args[i]; if(!cmSystemTools::FileIsFullPath(script.c_str())) { - script = this->Makefile->GetCurrentDirectory(); + script = this->Makefile->GetCurrentSourceDirectory(); script += "/"; script += args[i]; } @@ -1093,7 +1093,7 @@ cmInstallCommand::HandleDirectoryMode(std::vector<std::string> const& args) std::string dir = args[i]; if(!cmSystemTools::FileIsFullPath(dir.c_str())) { - dir = this->Makefile->GetCurrentDirectory(); + dir = this->Makefile->GetCurrentSourceDirectory(); dir += "/"; dir += args[i]; } @@ -1376,7 +1376,7 @@ bool cmInstallCommand::MakeFilesFullPath(const char* modeName, std::string::size_type gpos = cmGeneratorExpression::Find(file); if(gpos != 0 && !cmSystemTools::FileIsFullPath(file.c_str())) { - file = this->Makefile->GetCurrentDirectory(); + file = this->Makefile->GetCurrentSourceDirectory(); file += "/"; file += *fileIt; } diff --git a/Source/cmInstallFilesCommand.cxx b/Source/cmInstallFilesCommand.cxx index 85e5345..64556d0 100644 --- a/Source/cmInstallFilesCommand.cxx +++ b/Source/cmInstallFilesCommand.cxx @@ -95,7 +95,7 @@ void cmInstallFilesCommand::FinalPass() { std::vector<std::string> files; std::string regex = this->FinalArgs[0]; - cmSystemTools::Glob(this->Makefile->GetCurrentDirectory(), + cmSystemTools::Glob(this->Makefile->GetCurrentSourceDirectory(), regex, files); std::vector<std::string>::iterator s = files.begin(); @@ -155,7 +155,7 @@ std::string cmInstallFilesCommand::FindInstallSource(const char* name) const std::string tb = this->Makefile->GetCurrentOutputDirectory(); tb += "/"; tb += name; - std::string ts = this->Makefile->GetCurrentDirectory(); + std::string ts = this->Makefile->GetCurrentSourceDirectory(); ts += "/"; ts += name; diff --git a/Source/cmInstallProgramsCommand.cxx b/Source/cmInstallProgramsCommand.cxx index cc223ab..db1ee79 100644 --- a/Source/cmInstallProgramsCommand.cxx +++ b/Source/cmInstallProgramsCommand.cxx @@ -63,7 +63,7 @@ void cmInstallProgramsCommand::FinalPass() else // reg exp list { std::vector<std::string> programs; - cmSystemTools::Glob(this->Makefile->GetCurrentDirectory(), + cmSystemTools::Glob(this->Makefile->GetCurrentSourceDirectory(), this->FinalArgs[0], programs); std::vector<std::string>::iterator s = programs.begin(); @@ -118,7 +118,7 @@ std::string cmInstallProgramsCommand std::string tb = this->Makefile->GetCurrentOutputDirectory(); tb += "/"; tb += name; - std::string ts = this->Makefile->GetCurrentDirectory(); + std::string ts = this->Makefile->GetCurrentSourceDirectory(); ts += "/"; ts += name; diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 1fd8ebb..5e47b91 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -438,7 +438,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 @@ -2159,7 +2160,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; diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 90a6410..251e840 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -269,7 +269,7 @@ void cmMakefile::IssueMessage(cmake::MessageType t, if(this->ListFileStack.empty()) { // We are not processing the project. Add the directory-level context. - lfc.FilePath = this->GetCurrentDirectory(); + lfc.FilePath = this->GetCurrentSourceDirectory(); lfc.FilePath += "/CMakeLists.txt"; } else @@ -1622,7 +1622,7 @@ void cmMakefile::ConfigureSubDirectory(cmLocalGenerator *lg2) if (this->GetCMakeInstance()->GetDebugOutput()) { std::string msg=" Entering "; - msg += lg2->GetMakefile()->GetCurrentDirectory(); + msg += lg2->GetMakefile()->GetCurrentSourceDirectory(); cmSystemTools::Message(msg.c_str()); } // finally configure the subdir @@ -1630,7 +1630,7 @@ void cmMakefile::ConfigureSubDirectory(cmLocalGenerator *lg2) if (this->GetCMakeInstance()->GetDebugOutput()) { std::string msg=" Returning to "; - msg += this->GetCurrentDirectory(); + msg += this->GetCurrentSourceDirectory(); cmSystemTools::Message(msg.c_str()); } } @@ -4039,7 +4039,7 @@ void cmMakefile::SetProperty(const std::string& prop, const char* value) if ( prop == "ADDITIONAL_MAKE_CLEAN_FILES" ) { // This property is not inherrited - if ( strcmp(this->GetCurrentDirectory(), + if ( strcmp(this->GetCurrentSourceDirectory(), this->GetStartDirectory()) != 0 ) { return; @@ -4307,7 +4307,7 @@ void cmMakefile::AddCMakeDependFilesFromUser() } else { - std::string f = this->GetCurrentDirectory(); + std::string f = this->GetCurrentSourceDirectory(); f += "/"; f += *i; this->AddCMakeDependFile(f); @@ -4588,7 +4588,7 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg, default: break; } e << "created in source directory \"" - << existing->GetMakefile()->GetCurrentDirectory() << "\". " + << existing->GetMakefile()->GetCurrentSourceDirectory() << "\". " << "See documentation for policy CMP0002 for more details."; msg = e.str(); return false; diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 356e4c2..8aec647 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -484,7 +484,7 @@ public: } //@} - const char* GetCurrentDirectory() const + const char* GetCurrentSourceDirectory() const { return this->cmStartDirectory.c_str(); } diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index 43b02bc..af62b0b 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -33,7 +33,7 @@ bool cmProjectCommand "Value Computed by CMake", cmState::STATIC); this->Makefile->AddCacheDefinition (srcdir, - this->Makefile->GetCurrentDirectory(), + this->Makefile->GetCurrentSourceDirectory(), "Value Computed by CMake", cmState::STATIC); bindir = "PROJECT_BINARY_DIR"; @@ -42,7 +42,7 @@ bool cmProjectCommand this->Makefile->AddDefinition(bindir, this->Makefile->GetCurrentOutputDirectory()); this->Makefile->AddDefinition(srcdir, - this->Makefile->GetCurrentDirectory()); + this->Makefile->GetCurrentSourceDirectory()); this->Makefile->AddDefinition("PROJECT_NAME", args[0].c_str()); diff --git a/Source/cmQTWrapCPPCommand.cxx b/Source/cmQTWrapCPPCommand.cxx index 878562c..655bf82 100644 --- a/Source/cmQTWrapCPPCommand.cxx +++ b/Source/cmQTWrapCPPCommand.cxx @@ -66,7 +66,7 @@ bool cmQTWrapCPPCommand::InitialPass(std::vector<std::string> const& args, } else { - hname = this->Makefile->GetCurrentDirectory(); + hname = this->Makefile->GetCurrentSourceDirectory(); } hname += "/"; hname += *j; diff --git a/Source/cmQTWrapUICommand.cxx b/Source/cmQTWrapUICommand.cxx index 9b92b1e..b1e43b8 100644 --- a/Source/cmQTWrapUICommand.cxx +++ b/Source/cmQTWrapUICommand.cxx @@ -73,7 +73,7 @@ bool cmQTWrapUICommand::InitialPass(std::vector<std::string> const& args, } else { - uiName = this->Makefile->GetCurrentDirectory(); + uiName = this->Makefile->GetCurrentSourceDirectory(); } uiName += "/"; uiName += *j; diff --git a/Source/cmSearchPath.cxx b/Source/cmSearchPath.cxx index 045c82e..c9cc817 100644 --- a/Source/cmSearchPath.cxx +++ b/Source/cmSearchPath.cxx @@ -86,7 +86,7 @@ void cmSearchPath::AddUserPath(const std::string& path) for(std::vector<std::string>::const_iterator p = outPaths.begin(); p != outPaths.end(); ++p) { - this->AddPathInternal(*p, this->FC->Makefile->GetCurrentDirectory()); + this->AddPathInternal(*p, this->FC->Makefile->GetCurrentSourceDirectory()); } } @@ -104,7 +104,8 @@ void cmSearchPath::AddCMakePath(const std::string& variable) for(std::vector<std::string>::const_iterator p = expanded.begin(); p!= expanded.end(); ++p) { - this->AddPathInternal(*p, this->FC->Makefile->GetCurrentDirectory()); + this->AddPathInternal(*p, + this->FC->Makefile->GetCurrentSourceDirectory()); } } } @@ -132,7 +133,8 @@ void cmSearchPath::AddCMakePrefixPath(const std::string& variable) std::vector<std::string> expanded; cmSystemTools::ExpandListArgument(value, expanded); - this->AddPrefixPaths(expanded, this->FC->Makefile->GetCurrentDirectory()); + this->AddPrefixPaths(expanded, + this->FC->Makefile->GetCurrentSourceDirectory()); } } diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx index bb94a72..35262b6 100644 --- a/Source/cmSetPropertyCommand.cxx +++ b/Source/cmSetPropertyCommand.cxx @@ -197,7 +197,7 @@ bool cmSetPropertyCommand::HandleDirectoryMode() std::string dir = *this->Names.begin(); if(!cmSystemTools::FileIsFullPath(dir.c_str())) { - dir = this->Makefile->GetCurrentDirectory(); + dir = this->Makefile->GetCurrentSourceDirectory(); dir += "/"; dir += *this->Names.begin(); } diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index 6847475..c28d7b4 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -162,7 +162,7 @@ bool cmSourceFile::FindFullPath(std::string* error) const char* tryDirs[3] = {0, 0, 0}; if(this->Location.DirectoryIsAmbiguous()) { - tryDirs[0] = mf->GetCurrentDirectory(); + tryDirs[0] = mf->GetCurrentSourceDirectory(); tryDirs[1] = mf->GetCurrentOutputDirectory(); } else diff --git a/Source/cmSourceFileLocation.cxx b/Source/cmSourceFileLocation.cxx index 9d67c1e..d88a5f2 100644 --- a/Source/cmSourceFileLocation.cxx +++ b/Source/cmSourceFileLocation.cxx @@ -93,7 +93,7 @@ void cmSourceFileLocation::DirectoryUseSource() { this->Directory = cmSystemTools::CollapseFullPath( - this->Directory, this->Makefile->GetCurrentDirectory()); + this->Directory, this->Makefile->GetCurrentSourceDirectory()); this->AmbiguousDirectory = false; } } @@ -143,7 +143,7 @@ void cmSourceFileLocation::UpdateExtension(const std::string& name) // Check the source tree only because a file in the build tree should // be specified by full path at least once. We do not want this // detection to depend on whether the project has already been built. - tryPath = this->Makefile->GetCurrentDirectory(); + tryPath = this->Makefile->GetCurrentSourceDirectory(); tryPath += "/"; } if(!this->Directory.empty()) @@ -282,7 +282,7 @@ bool cmSourceFileLocation::Matches(cmSourceFileLocation const& loc) // Compare possible directory combinations. std::string const& srcDir = cmSystemTools::CollapseFullPath( - this->Directory, this->Makefile->GetCurrentDirectory()); + this->Directory, this->Makefile->GetCurrentSourceDirectory()); std::string const& binDir = cmSystemTools::CollapseFullPath( this->Directory, this->Makefile->GetCurrentOutputDirectory()); @@ -297,7 +297,7 @@ bool cmSourceFileLocation::Matches(cmSourceFileLocation const& loc) // Compare possible directory combinations. std::string const& srcDir = cmSystemTools::CollapseFullPath( - loc.Directory, loc.Makefile->GetCurrentDirectory()); + loc.Directory, loc.Makefile->GetCurrentSourceDirectory()); std::string const& binDir = cmSystemTools::CollapseFullPath( loc.Directory, loc.Makefile->GetCurrentOutputDirectory()); diff --git a/Source/cmSourceGroupCommand.cxx b/Source/cmSourceGroupCommand.cxx index 1741e05..fadb172 100644 --- a/Source/cmSourceGroupCommand.cxx +++ b/Source/cmSourceGroupCommand.cxx @@ -81,7 +81,7 @@ bool cmSourceGroupCommand std::string src = args[i]; if(!cmSystemTools::FileIsFullPath(src.c_str())) { - src = this->Makefile->GetCurrentDirectory(); + src = this->Makefile->GetCurrentSourceDirectory(); src += "/"; src += args[i]; } diff --git a/Source/cmSubdirCommand.cxx b/Source/cmSubdirCommand.cxx index 7cb2edc..47198a3 100644 --- a/Source/cmSubdirCommand.cxx +++ b/Source/cmSubdirCommand.cxx @@ -39,7 +39,7 @@ bool cmSubdirCommand // if they specified a relative path then compute the full std::string srcPath = - std::string(this->Makefile->GetCurrentDirectory()) + + std::string(this->Makefile->GetCurrentSourceDirectory()) + "/" + i->c_str(); if (cmSystemTools::FileIsDirectory(srcPath)) { diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx index 10122e9..6f2f950 100644 --- a/Source/cmUtilitySourceCommand.cxx +++ b/Source/cmUtilitySourceCommand.cxx @@ -75,7 +75,7 @@ bool cmUtilitySourceCommand // The third argument specifies the relative directory of the source // of the utility. std::string relativeSource = *arg++; - std::string utilitySource = this->Makefile->GetCurrentDirectory(); + std::string utilitySource = this->Makefile->GetCurrentSourceDirectory(); utilitySource = utilitySource+"/"+relativeSource; // If the directory doesn't exist, the source has not been included. diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index dad6f93..838d390 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -2194,7 +2194,7 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions( { // Look through the sources for AndroidManifest.xml and use // its location as the root source directory. - std::string rootDir = this->Makefile->GetCurrentDirectory(); + std::string rootDir = this->Makefile->GetCurrentSourceDirectory(); { std::vector<cmSourceFile const*> extraSources; this->GeneratorTarget->GetExtraSources(extraSources, ""); diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index c8cf2d4..7d33f04 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -154,7 +154,7 @@ static void cmakemainProgressCallback(const char *m, float prog, if ((mf) && (strstr(m, "Configuring")==m) && (prog<0)) { dir = " "; - dir += mf->GetCurrentDirectory(); + dir += mf->GetCurrentSourceDirectory(); } else if ((mf) && (strstr(m, "Generating")==m)) { |