mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-29 04:09:35 +03:00
Help: Clarify ordering of list(REMOVE_DUPLICATES)
This also adds a test to enforce the order behavior of list(REMOVE_DUPLICATES).
This commit is contained in:
1 parent
b13a8441cd
commit
258298f597
3 files changed
+9
-1
No files matched your search
@@ -196,7 +196,8 @@ Removes items at given indices from the list.
|
||||
|
||||
list(REMOVE_DUPLICATES <list>)
|
||||
|
||||
Removes duplicated items in the list.
|
||||
Removes duplicated items in the list. The relative order of items is preserved,
|
||||
but if duplicates are encountered, only the first instance is preserved.
|
||||
|
||||
.. _TRANSFORM:
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
set(mylist "b;c;b;a;a;c;b;a;c;b")
|
||||
list(REMOVE_DUPLICATES mylist)
|
||||
if(NOT mylist STREQUAL "b;c;a")
|
||||
message(SEND_ERROR "Expected b;c;a, got ${mylist}")
|
||||
endif()
|
||||
@@ -24,6 +24,8 @@ run_cmake(SUBLIST-TooManyArguments)
|
||||
|
||||
run_cmake(REMOVE_AT-EmptyList)
|
||||
|
||||
run_cmake(REMOVE_DUPLICATES-PreserveOrder)
|
||||
|
||||
run_cmake(FILTER-NotList)
|
||||
run_cmake(REMOVE_AT-NotList)
|
||||
run_cmake(REMOVE_DUPLICATES-NotList)
|
||||
|
||||
Reference in new issue
Block a user