diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 685944582..2bad32c5d 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -141,7 +141,10 @@ cmNinjaNormalTargetGenerator vars.CMTarget = this->GetTarget(); vars.Language = this->TargetLinkLanguage; vars.Objects = "$in"; - std::string objdir = cmake::GetCMakeFilesDirectoryPostSlash(); + std::string objdir = + this->GetLocalGenerator()->GetHomeRelativeOutputPath(); + objdir += objdir.empty() ? "" : "/"; + objdir += cmake::GetCMakeFilesDirectoryPostSlash(); objdir += this->GetTargetName(); objdir += ".dir"; objdir = this->GetLocalGenerator()->Convert(objdir.c_str(),