Files
cmake/Tests/RunCMake/list/SORT-COMPARATOR-NoFunction.cmake
Mickaël Germain 3dc32ac62b list(SORT): Add COMPARATOR option for user-defined comparisons
Allow users to provide a custom comparison function for `list(SORT)`.
The comparator is validated for strict weak ordering at runtime to
produce a clear CMake error rather than a platform-dependent abort.

Closes: #27761
2026-05-06 15:09:06 -04:00

3 lines
47 B
CMake

set(mylist a b c)
list(SORT mylist COMPARATOR)