diff options
author | Stephen Kelly <steveire@gmail.com> | 2016-09-06 21:29:01 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2016-09-19 19:36:13 (GMT) |
commit | e13e519e1c3f76b826365b5fa72a50dba180c191 (patch) | |
tree | 85e9c3d6c9fb959d1dfe5093aba5c0fdf09ccfc9 /Source | |
parent | 34c6e995f9ac1c62540b68dd50934c8c0be98b7f (diff) | |
download | CMake-e13e519e1c3f76b826365b5fa72a50dba180c191.zip CMake-e13e519e1c3f76b826365b5fa72a50dba180c191.tar.gz CMake-e13e519e1c3f76b826365b5fa72a50dba180c191.tar.bz2 |
Convert: Move access to BinaryDirectory out of loops
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmExtraEclipseCDT4Generator.cxx | 2 | ||||
-rw-r--r-- | Source/cmGlobalUnixMakefileGenerator3.cxx | 10 | ||||
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 6 |
3 files changed, 7 insertions, 11 deletions
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index d1be0c7..61f2851 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -914,7 +914,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const const std::vector<cmGeneratorTarget*> targets = (*it)->GetGeneratorTargets(); std::string subdir = (*it)->ConvertToRelativePath( - (*it)->GetBinaryDirectory(), (*it)->GetCurrentBinaryDirectory()); + this->HomeOutputDirectory, (*it)->GetCurrentBinaryDirectory()); if (subdir == ".") { subdir = ""; } diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 5438375..c17eb23 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -347,6 +347,8 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile() << "\"\n"; cmakefileStream << " )\n\n"; + const std::string binDir = lg->GetBinaryDirectory(); + // CMake must rerun if a byproduct is missing. { cmakefileStream << "# Byproducts of CMake generate step:\n" @@ -355,9 +357,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile() lg->GetMakefile()->GetOutputFiles(); for (std::vector<std::string>::const_iterator k = outfiles.begin(); k != outfiles.end(); ++k) { - cmakefileStream << " \"" - << lg->ConvertToRelativePath(lg->GetBinaryDirectory(), - *k) + cmakefileStream << " \"" << lg->ConvertToRelativePath(binDir, *k) << "\"\n"; } @@ -369,9 +369,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile() tmpStr = lg->GetCurrentBinaryDirectory(); tmpStr += cmake::GetCMakeFilesDirectory(); tmpStr += "/CMakeDirectoryInformation.cmake"; - cmakefileStream << " \"" - << lg->ConvertToRelativePath(lg->GetBinaryDirectory(), - tmpStr) + cmakefileStream << " \"" << lg->ConvertToRelativePath(binDir, tmpStr) << "\"\n"; } cmakefileStream << " )\n\n"; diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 6d2dac2..697d856 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1853,9 +1853,9 @@ void cmLocalUnixMakefileGenerator3::WriteDependLanguageInfo( const std::string& config = this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"); this->GetIncludeDirectories(includes, target, l->first, config); + std::string binaryDir = this->GetState()->GetBinaryDirectory(); if (this->Makefile->IsOn("CMAKE_DEPENDS_IN_PROJECT_ONLY")) { const char* sourceDir = this->GetState()->GetSourceDirectory(); - const char* binaryDir = this->GetState()->GetBinaryDirectory(); std::vector<std::string>::iterator itr = std::remove_if(includes.begin(), includes.end(), ::NotInProjectDir(sourceDir, binaryDir)); @@ -1863,9 +1863,7 @@ void cmLocalUnixMakefileGenerator3::WriteDependLanguageInfo( } for (std::vector<std::string>::iterator i = includes.begin(); i != includes.end(); ++i) { - cmakefileStream << " \"" - << this->ConvertToRelativePath( - this->GetBinaryDirectory(), *i) + cmakefileStream << " \"" << this->ConvertToRelativePath(binaryDir, *i) << "\"\n"; } cmakefileStream << " )\n"; |