On 05/16/2016 05:23 PM, Reiner Herrmann wrote: > Unfortunately many projects still use this for finding source files [1], > without considering sorting. > Without sorting it in file(GLOB), most of those packages have to be > patched individually. Would sorting by default really have such a > noticable performance impact? I can't imagine there are many projects > where sorting time isn't negligible.
I also doubt the in-memory sorting time is noticeable. If it turns out to be a problem we can look at more efficient implementations. There is an open issue about this too: https://cmake.org/Bug/view.php?id=14491 Even when file(GLOB) is used as a primitive for a purpose other than collecting a list of source files, deterministic results are useful. I've decided to apply the patch and merge to 'next' for testing: file: Sort GLOB results to make it deterministic (#14491) https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=edcccde7 I also updated the test suite to cover it. I revised the wording of the documentation to not promise sorting, only determinism. When multiple globbing patterns are used we still sort only the results of each individual pattern, so overall the results are not necessarily sorted. Thanks, -Brad -- 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://public.kitware.com/mailman/listinfo/cmake-developers