summaryrefslogtreecommitdiffstats
path: root/Source/cmDependsFortran.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2016-09-07 21:14:30 (GMT)
committerStephen Kelly <steveire@gmail.com>2016-09-19 19:36:13 (GMT)
commit1825f876a7467a97b1cb3f6dd60f95c173d9e61b (patch)
tree0d70f9ac13c2886f0ec77e2156956b05c7067e3e /Source/cmDependsFortran.cxx
parent25c39ac28b42234d08c3906ce24ac739f6111506 (diff)
downloadCMake-1825f876a7467a97b1cb3f6dd60f95c173d9e61b.zip
CMake-1825f876a7467a97b1cb3f6dd60f95c173d9e61b.tar.gz
CMake-1825f876a7467a97b1cb3f6dd60f95c173d9e61b.tar.bz2
Convert: Move access to BinaryDirectory out of loops
Diffstat (limited to 'Source/cmDependsFortran.cxx')
-rw-r--r--Source/cmDependsFortran.cxx40
1 files changed, 12 insertions, 28 deletions
diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx
index 8317534..d7e2c33 100644
--- a/Source/cmDependsFortran.cxx
+++ b/Source/cmDependsFortran.cxx
@@ -331,20 +331,18 @@ bool cmDependsFortran::WriteDependenciesReal(const char* obj,
const char* src = info.Source.c_str();
// Write the include dependencies to the output stream.
- std::string obj_i = this->LocalGenerator->ConvertToRelativePath(
- this->LocalGenerator->GetBinaryDirectory(), obj);
+ std::string binDir = this->LocalGenerator->GetBinaryDirectory();
+ std::string obj_i = this->LocalGenerator->ConvertToRelativePath(binDir, obj);
std::string obj_m = cmSystemTools::ConvertToOutputPath(obj_i.c_str());
internalDepends << obj_i << std::endl;
internalDepends << " " << src << std::endl;
for (std::set<std::string>::const_iterator i = info.Includes.begin();
i != info.Includes.end(); ++i) {
- makeDepends << obj_m << ": "
- << cmSystemTools::ConvertToOutputPath(
- this->LocalGenerator
- ->ConvertToRelativePath(
- this->LocalGenerator->GetBinaryDirectory(), *i)
- .c_str())
- << std::endl;
+ makeDepends
+ << obj_m << ": "
+ << cmSystemTools::ConvertToOutputPath(
+ this->LocalGenerator->ConvertToRelativePath(binDir, *i).c_str())
+ << std::endl;
internalDepends << " " << *i << std::endl;
}
makeDepends << std::endl;
@@ -370,10 +368,7 @@ bool cmDependsFortran::WriteDependenciesReal(const char* obj,
proxy += *i;
proxy += ".mod.proxy";
proxy = cmSystemTools::ConvertToOutputPath(
- this->LocalGenerator
- ->ConvertToRelativePath(this->LocalGenerator->GetBinaryDirectory(),
- proxy)
- .c_str());
+ this->LocalGenerator->ConvertToRelativePath(binDir, proxy).c_str());
// since we require some things add them to our list of requirements
makeDepends << obj_m << ".requires: " << proxy << std::endl;
@@ -389,9 +384,7 @@ bool cmDependsFortran::WriteDependenciesReal(const char* obj,
if (!required->second.empty()) {
// This module is known. Depend on its timestamp file.
std::string stampFile = cmSystemTools::ConvertToOutputPath(
- this->LocalGenerator
- ->ConvertToRelativePath(this->LocalGenerator->GetBinaryDirectory(),
- required->second)
+ this->LocalGenerator->ConvertToRelativePath(binDir, required->second)
.c_str());
makeDepends << obj_m << ": " << stampFile << "\n";
} else {
@@ -400,10 +393,7 @@ bool cmDependsFortran::WriteDependenciesReal(const char* obj,
std::string module;
if (this->FindModule(*i, module)) {
module = cmSystemTools::ConvertToOutputPath(
- this->LocalGenerator
- ->ConvertToRelativePath(this->LocalGenerator->GetBinaryDirectory(),
- module)
- .c_str());
+ this->LocalGenerator->ConvertToRelativePath(binDir, module).c_str());
makeDepends << obj_m << ": " << module << "\n";
}
}
@@ -417,10 +407,7 @@ bool cmDependsFortran::WriteDependenciesReal(const char* obj,
proxy += *i;
proxy += ".mod.proxy";
proxy = cmSystemTools::ConvertToOutputPath(
- this->LocalGenerator
- ->ConvertToRelativePath(this->LocalGenerator->GetBinaryDirectory(),
- proxy)
- .c_str());
+ this->LocalGenerator->ConvertToRelativePath(binDir, proxy).c_str());
makeDepends << proxy << ": " << obj_m << ".provides" << std::endl;
}
@@ -468,10 +455,7 @@ bool cmDependsFortran::WriteDependenciesReal(const char* obj,
std::string driver = this->TargetDirectory;
driver += "/build";
driver = cmSystemTools::ConvertToOutputPath(
- this->LocalGenerator
- ->ConvertToRelativePath(this->LocalGenerator->GetBinaryDirectory(),
- driver)
- .c_str());
+ this->LocalGenerator->ConvertToRelativePath(binDir, driver).c_str());
makeDepends << driver << ": " << obj_m << ".provides.build\n";
}