[cmake-developers] [PATCH] Sort list of files for aux_source_directory() and file(glob, *)

Brad King brad.king at kitware.com
Tue Sep 27 07:55:38 EDT 2016


On 09/27/2016 12:20 AM, Junghyun Kim wrote:
> If aux_source_directory(. SRCS) or file(glob SRCS "*.c") is used
> files in SRCS are not sorted.

The file(GLOB) command sorts as of CMake 3.6:

  file: Sort GLOB results to make it deterministic (#14491)
  https://gitlab.kitware.com/cmake/cmake/commit/edcccde7

A similar change could be made to aux_source_directory, though there is
little reason to use that ancient command these days.  Also, the CMake
documentation recommends against using file(GLOB) to collect sources.

-Brad



More information about the cmake-developers mailing list