[Cmake-commits] CMake branch, master, updated. v3.14.0-rc2-276-g0d9471f
Kitware Robot
kwrobot at kitware.com
Thu Feb 28 10:23:08 EST 2019
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, master has been updated
via 0d9471fa2dee221aef8166ea370a98cc26d783e4 (commit)
via 258298f59799311ad6a3f261f7e7bebcaf346657 (commit)
from 0df31d99ae44e1e151feb4df977a4332833ea872 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0d9471fa2dee221aef8166ea370a98cc26d783e4
commit 0d9471fa2dee221aef8166ea370a98cc26d783e4
Merge: 0df31d9 258298f
Author: Kyle Edwards <kyle.edwards at kitware.com>
AuthorDate: Thu Feb 28 15:18:44 2019 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Thu Feb 28 10:18:52 2019 -0500
Merge topic 'remove_duplicates-order'
258298f597 Help: Clarify ordering of list(REMOVE_DUPLICATES)
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !3035
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=258298f59799311ad6a3f261f7e7bebcaf346657
commit 258298f59799311ad6a3f261f7e7bebcaf346657
Author: Kyle Edwards <kyle.edwards at kitware.com>
AuthorDate: Wed Feb 27 11:22:57 2019 -0500
Commit: Kyle Edwards <kyle.edwards at kitware.com>
CommitDate: Wed Feb 27 11:22:57 2019 -0500
Help: Clarify ordering of list(REMOVE_DUPLICATES)
This also adds a test to enforce the order behavior of
list(REMOVE_DUPLICATES).
diff --git a/Help/command/list.rst b/Help/command/list.rst
index 6c86c2a..4444af7 100644
--- a/Help/command/list.rst
+++ b/Help/command/list.rst
@@ -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:
diff --git a/Tests/RunCMake/list/REMOVE_DUPLICATES-PreserveOrder.cmake b/Tests/RunCMake/list/REMOVE_DUPLICATES-PreserveOrder.cmake
new file mode 100644
index 0000000..91abbd6
--- /dev/null
+++ b/Tests/RunCMake/list/REMOVE_DUPLICATES-PreserveOrder.cmake
@@ -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()
diff --git a/Tests/RunCMake/list/RunCMakeTest.cmake b/Tests/RunCMake/list/RunCMakeTest.cmake
index 59c7ea5..b4a91bc 100644
--- a/Tests/RunCMake/list/RunCMakeTest.cmake
+++ b/Tests/RunCMake/list/RunCMakeTest.cmake
@@ -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)
-----------------------------------------------------------------------
Summary of changes:
Help/command/list.rst | 3 ++-
Tests/RunCMake/list/REMOVE_DUPLICATES-PreserveOrder.cmake | 5 +++++
Tests/RunCMake/list/RunCMakeTest.cmake | 2 ++
3 files changed, 9 insertions(+), 1 deletion(-)
create mode 100644 Tests/RunCMake/list/REMOVE_DUPLICATES-PreserveOrder.cmake
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list