Skip to content

list: Add options to control the SORT comparison operation

Daniel Franke requested to merge DerDan/cmake:list_sort into master

Command list, subcommand sort extended by option to sort list(SORT <list> [COMPARE <compare>] [CASE <case>] [ORDER <order>] )

Sorts the list in-place alphabetically. Use the option <compare> to select the compare type for sorting. The option may be one of:

STRING : Sorts a list of strings alphabetically.
FILE_BASENAME : Sort a list of pathnames of files by their basenames.

Use the option <case> to select a case sensitive or case insensitive sort mode. The option may be one of:

SENSITIVE : Sorts the list case sensitive. 
INSENSITIVE : Sorts the list case insensitive.

Use the option <order> to select the sorting order

ASCENDING : Sorts the list in ascending order.
DESCENDING : Sorts the list in descending order.
Edited by Brad King

Merge request reports