From a48bb185c31ee17d9d8bb9f33ce7a00dd01f4fb5 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 21 Aug 2020 17:55:16 +0200 Subject: AutoGen: Fix moc and uic dependencies when building Qt itself When building Qt itself, the moc and uic executables are spcecified via a generator expression of the form $, which ends populating Moc's and Uic's 'Executable' field but not the ExecutableTarget and ExecutableTargetName fields. In such a scenario, the code in cmQtAutoGenInitializer::InitAutogenTarget fails to add a dependency on moc (or uic), because ExecutableTarget is null. First try to add a dependency on the ExecutableTarget if it's not empty, otherwise try to add a dependency on the path specified in the 'Executable' field. Issue: #21118 --- Source/cmQtAutoGenInitializer.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index 1132852..79927b9 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -1224,9 +1224,13 @@ bool cmQtAutoGenInitializer::InitAutogenTarget() if (this->Moc.ExecutableTarget != nullptr) { dependencies.push_back(this->Moc.ExecutableTarget->Target->GetName()); + } else if (!this->Moc.Executable.empty()) { + dependencies.push_back(this->Moc.Executable); } if (this->Uic.ExecutableTarget != nullptr) { dependencies.push_back(this->Uic.ExecutableTarget->Target->GetName()); + } else if (!this->Uic.Executable.empty()) { + dependencies.push_back(this->Uic.Executable); } // Create the custom command that outputs the timestamp file. -- cgit v0.12