summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-08-21 15:55:16 (GMT)
committerBrad King <brad.king@kitware.com>2020-08-25 16:29:23 (GMT)
commita48bb185c31ee17d9d8bb9f33ce7a00dd01f4fb5 (patch)
tree5823bed007c5ec593439cc1c3e08d577276d3585
parentaaa5eab410c2e3fe41ebf7a2316be9c51572dbd2 (diff)
downloadCMake-a48bb185c31ee17d9d8bb9f33ce7a00dd01f4fb5.zip
CMake-a48bb185c31ee17d9d8bb9f33ce7a00dd01f4fb5.tar.gz
CMake-a48bb185c31ee17d9d8bb9f33ce7a00dd01f4fb5.tar.bz2
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 $<TARGET_FILE:Qt6::moc>, 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
-rw-r--r--Source/cmQtAutoGenInitializer.cxx4
1 files changed, 4 insertions, 0 deletions
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.