diff options
author | Brad King <brad.king@kitware.com> | 2021-09-09 18:02:41 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-09-09 18:02:52 (GMT) |
commit | ed9abd99772cbdcb2e4dd195eb4a62104ce86c95 (patch) | |
tree | b39f042f9534d84e4570cdae0cfd3af63677d990 /Source | |
parent | 111f818b54c167ab08757f770289d17a6aef61e3 (diff) | |
parent | 8ff0c2b1dd4b74a1e8e7a79adbfc5db55edff393 (diff) | |
download | CMake-ed9abd99772cbdcb2e4dd195eb4a62104ce86c95.zip CMake-ed9abd99772cbdcb2e4dd195eb4a62104ce86c95.tar.gz CMake-ed9abd99772cbdcb2e4dd195eb4a62104ce86c95.tar.bz2 |
Merge topic 'mocmacrosonce'
8ff0c2b1dd AutoMoc: Do not list moc macros multiple times
6e2f4029c0 cmAlgorithms: Preserve const-ness in cmRemoveDuplicates range signature
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6459
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmAlgorithms.h | 8 | ||||
-rw-r--r-- | Source/cmQtAutoGenInitializer.cxx | 3 |
2 files changed, 10 insertions, 1 deletions
diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h index d00f420..a1830f9 100644 --- a/Source/cmAlgorithms.h +++ b/Source/cmAlgorithms.h @@ -137,7 +137,13 @@ ForwardIterator cmRemoveDuplicates(ForwardIterator first, ForwardIterator last) } template <typename Range> -typename Range::const_iterator cmRemoveDuplicates(Range& r) +typename Range::iterator cmRemoveDuplicates(Range& r) +{ + return cmRemoveDuplicates(r.begin(), r.end()); +} + +template <typename Range> +typename Range::const_iterator cmRemoveDuplicates(Range const& r) { return cmRemoveDuplicates(r.begin(), r.end()); } diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx index 4dd78e5..fe038c7 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")); |