diff options
author | David Redondo <kde@david-redondo.de> | 2021-08-18 11:28:01 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-09-03 13:41:12 (GMT) |
commit | 8ff0c2b1dd4b74a1e8e7a79adbfc5db55edff393 (patch) | |
tree | 0cf343ada0cf06d1d635bd3b1b033cb1145ca093 /Source | |
parent | 6e2f4029c0e850a7420fba2ab953c0b6323e13fb (diff) | |
download | CMake-8ff0c2b1dd4b74a1e8e7a79adbfc5db55edff393.zip CMake-8ff0c2b1dd4b74a1e8e7a79adbfc5db55edff393.tar.gz CMake-8ff0c2b1dd4b74a1e8e7a79adbfc5db55edff393.tar.bz2 |
AutoMoc: Do not list moc macros multiple times
When working on a project with a nested dependency tree, a macro
can be added multiple times. For example in a project I am working
on, in the warning "includes the moc file [... ] but does not contain
a [...] macro" the macro list contains 127 entries but only 25 unique
ones.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmQtAutoGenInitializer.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index 6cc8328..c7d38bb 100644 --- a/Source/cmQtAutoGenInitializer.cxx +++ b/Source/cmQtAutoGenInitializer.cxx @@ -24,6 +24,7 @@ #include "cmsys/SystemInformation.hxx" +#include "cmAlgorithms.h" #include "cmCustomCommand.h" #include "cmCustomCommandLines.h" #include "cmGeneratedFileStream.h" @@ -522,6 +523,8 @@ bool cmQtAutoGenInitializer::InitCustomTargets() // Filters cmExpandList(this->GenTarget->GetSafeProperty("AUTOMOC_MACRO_NAMES"), this->Moc.MacroNames); + this->Moc.MacroNames.erase(cmRemoveDuplicates(this->Moc.MacroNames), + this->Moc.MacroNames.end()); { auto filterList = cmExpandedList( this->GenTarget->GetSafeProperty("AUTOMOC_DEPEND_FILTERS")); |