diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-01-31 23:34:58 (GMT) |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-01-31 23:35:53 (GMT) |
commit | 7c664bb5b933e66c390b6edddd2c1de541aad40f (patch) | |
tree | 2dd6a41cf740b1cf956dc3f29af145df055657bb /Source/cmQtAutoGenInitializer.cxx | |
parent | 371e9e48a4186f41354938b0b805a351857c78a0 (diff) | |
download | CMake-7c664bb5b933e66c390b6edddd2c1de541aad40f.zip CMake-7c664bb5b933e66c390b6edddd2c1de541aad40f.tar.gz CMake-7c664bb5b933e66c390b6edddd2c1de541aad40f.tar.bz2 |
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
Diffstat (limited to 'Source/cmQtAutoGenInitializer.cxx')
-rw-r--r-- | Source/cmQtAutoGenInitializer.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
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 })); |