summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalUnixMakefileGenerator3.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2016-09-06 21:52:42 (GMT)
committerStephen Kelly <steveire@gmail.com>2016-09-19 19:36:12 (GMT)
commit839c65bca032b80cfa7fe0de2ad35c2448421092 (patch)
tree89128503dafc452ce33455f6dbce08927b48be3d /Source/cmLocalUnixMakefileGenerator3.cxx
parent21b5fdf9a39f739c3566f3e77a4c5244da1b7e3a (diff)
downloadCMake-839c65bca032b80cfa7fe0de2ad35c2448421092.zip
CMake-839c65bca032b80cfa7fe0de2ad35c2448421092.tar.gz
CMake-839c65bca032b80cfa7fe0de2ad35c2448421092.tar.bz2
Convert: Move access to CurrentBinaryDirectory out of loops
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator3.cxx')
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 2b22f49..9d3567e 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -952,6 +952,7 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
// Add each command line to the set of commands.
std::vector<std::string> commands1;
+ std::string currentBinDir = this->GetCurrentBinaryDirectory();
for (unsigned int c = 0; c < ccg.GetNumberOfCommands(); ++c) {
// Build the command line in a single string.
std::string cmd = ccg.GetCommand(c);
@@ -976,8 +977,7 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand(
// working directory will be the start-output directory.
bool had_slash = cmd.find('/') != cmd.npos;
if (workingDir.empty()) {
- cmd =
- this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(), cmd);
+ cmd = this->ConvertToRelativePath(currentBinDir, cmd);
}
bool has_slash = cmd.find('/') != cmd.npos;
if (had_slash && !has_slash) {
@@ -1069,7 +1069,8 @@ void cmLocalUnixMakefileGenerator3::AppendCleanCommand(
std::vector<std::string>& commands, const std::vector<std::string>& files,
cmGeneratorTarget* target, const char* filename)
{
- std::string cleanfile = this->GetCurrentBinaryDirectory();
+ std::string currentBinDir = this->GetCurrentBinaryDirectory();
+ std::string cleanfile = currentBinDir;
cleanfile += "/";
cleanfile += this->GetTargetDirectory(target);
cleanfile += "/cmake_clean";
@@ -1087,8 +1088,7 @@ void cmLocalUnixMakefileGenerator3::AppendCleanCommand(
fout << "file(REMOVE_RECURSE\n";
for (std::vector<std::string>::const_iterator f = files.begin();
f != files.end(); ++f) {
- std::string fc =
- this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(), *f);
+ std::string fc = this->ConvertToRelativePath(currentBinDir, *f);
fout << " " << cmOutputConverter::EscapeForCMake(fc) << "\n";
}
fout << ")\n";