From 7c664bb5b933e66c390b6edddd2c1de541aad40f Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Sat, 1 Feb 2020 00:34:58 +0100 Subject: Fix AUTOMOC deps file to contain correct rule name The rule name should include the current binary path relative to the top level binary path. Fixes: #20298 --- Source/cmQtAutoGenInitializer.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index 0493c0f..43e159c 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -1189,8 +1189,15 @@ bool cmQtAutoGenInitializer::InitAutogenTarget() const std::string outputFile = cmStrCat(this->Dir.Build, "/", timestampFileName); this->AutogenTarget.DepFile = cmStrCat(this->Dir.Build, "/deps"); + auto relativeBinaryDir = cmSystemTools::RelativePath( + this->LocalGen->GetBinaryDirectory(), + this->LocalGen->GetCurrentBinaryDirectory()); + if (!relativeBinaryDir.empty()) { + relativeBinaryDir = cmStrCat(relativeBinaryDir, "/"); + } this->AutogenTarget.DepFileRuleName = - cmStrCat(this->GenTarget->GetName(), "_autogen/", timestampFileName); + cmStrCat(relativeBinaryDir, this->GenTarget->GetName(), "_autogen/", + timestampFileName); commandLines.push_back(cmMakeCommandLine( { cmSystemTools::GetCMakeCommand(), "-E", "touch", outputFile })); -- cgit v0.12