mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-02 20:29:49 -05:00
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
This commit is contained in:
@@ -1189,8 +1189,15 @@ bool cmQtAutoGenInitializer::InitAutogenTarget()
|
|||||||
const std::string outputFile =
|
const std::string outputFile =
|
||||||
cmStrCat(this->Dir.Build, "/", timestampFileName);
|
cmStrCat(this->Dir.Build, "/", timestampFileName);
|
||||||
this->AutogenTarget.DepFile = cmStrCat(this->Dir.Build, "/deps");
|
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 =
|
this->AutogenTarget.DepFileRuleName =
|
||||||
cmStrCat(this->GenTarget->GetName(), "_autogen/", timestampFileName);
|
cmStrCat(relativeBinaryDir, this->GenTarget->GetName(), "_autogen/",
|
||||||
|
timestampFileName);
|
||||||
commandLines.push_back(cmMakeCommandLine(
|
commandLines.push_back(cmMakeCommandLine(
|
||||||
{ cmSystemTools::GetCMakeCommand(), "-E", "touch", outputFile }));
|
{ cmSystemTools::GetCMakeCommand(), "-E", "touch", outputFile }));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user