[CMake] Possible differences in result of list(SORT)

Nils Gladitz nilsgladitz at gmail.com
Mon Oct 21 08:27:35 EDT 2013


list(SORT) does an std::sort() of std::strings.
I think CMake does not perform any character set conversions so the 
available strings retain the encoding as used in the input file and 
std::string ordering is based on byte-wise comparison.

Nils

On 10/21/2013 12:58 PM, Ingolf Steinbach wrote:
> Hi,
>
> according to the documentation, list(SORT <list>) "sorts the list
> in-place alphabetically". Without changing the host system: Does the
> order depend on any additional input (like settings of environment
> variables)?
>
> For instance the sort tool (on POSIX systems) shows significant
> dependencies with respect to LANG, LC_COLLATE, ... which can result in
> different order: "E;f;e;F" can result in "E;F;e;f" (i.e. upper case
> first) when using LANG=C and "e;E;f;F" when using LANG=en_US.UTF-8.
>
> I'm mainly interested in the behavior of CMake 2.8.10.2, but maybe
> there is a general answer to the question.
>
> Kind regards
> Ingolf
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake



More information about the CMake mailing list