diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 5b4ecc7ed6..eebab68664 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -995,14 +995,15 @@ void cmLocalUnixMakefileGenerator3::AppendCustomCommand( std::string output; const std::vector& outputs = ccg.GetOutputs(); if (!outputs.empty()) { + output = outputs[0]; if (workingDir.empty()) { output = this->MaybeConvertToRelativePath( - this->GetCurrentBinaryDirectory(), outputs[0]); - output = this->ConvertToOutputFormat(output, - cmOutputConverter::SHELL); + this->GetCurrentBinaryDirectory(), output); + output = + this->ConvertToOutputFormat(output, cmOutputConverter::SHELL); } else { - output = this->ConvertToOutputFormat(outputs[0], - cmOutputConverter::SHELL); + output = + this->ConvertToOutputFormat(output, cmOutputConverter::SHELL); } } vars.Output = output.c_str();