[CMake] file glob problems

Filipe Sousa filipe at ipb.pt
Fri Jun 16 13:39:15 EDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Clinton Stimpson wrote:
> So a
> 
> FILE(GLOB MYVAR "${SOMEDIR}/*/*.ext")
> 
> somedir/
>   a/a.ext
>   b/b.ext
>   c/c.ext
>  ....
> 
> On Windows, returns them in alphabetical order.
> On Linux, returns them in some random order.
> 
> How do we get it in alphabetical order all the time?
> 
> Clint
I would suggest LIST(SORT MYVAR) but for some reason is not implemented
but the documentation is there

fsousa at neptuno ~ $ cmake --help-command LIST
cmake version 2.5-20060615
  LIST
       List operations.

         LIST(LENGTH <list> <output variable>)
         LIST(GET <list> <element index> [<element index> ...] <output
variable>)
         LIST(APPEND <list> <element> [<element> ...])
         LIST(INSERT <list> <element_index> <element> [<element> ...])
         LIST(REMOVE_ITEM <list> <value> [<value> ...])
         LIST(REMOVE_AT <list> <index> [<index> ...])
         LIST(SORT <list>)
         LIST(REVERSE <list>)

CMake Error: Error in cmake code at
/home/fsousa/tmp/cc/CMakeLists.txt:2:
LIST does not recognize sub-command SORT

Looking at the code I can see that is not implemented
http://public.kitware.com/cgi-bin/viewcvs.cgi/Source/cmListCommand.cxx?rev=1.4.2.4&root=CMake&view=markup


- --
Filipe Sousa
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQFEkuzDbQdNYqwwwCwRAo13AKCoB4NbLRmU9FnUp3tHTzT88iL3zACgntZb
X6MDh7GLU3KnsC29OICzuso=
=Rh8j
-----END PGP SIGNATURE-----


More information about the CMake mailing list