[Cmake] howto sort a cmake list ?

William A. Hoffman billlist at nycap.rr.com
Fri, 20 Feb 2004 11:38:32 -0500


Thanks for the feedback.  Perhaps the answer is to change the visual
studio generator to sort the files before it puts them in the solution.

-Bill


At 10:04 AM 2/20/2004, Michael T. Wagner wrote:
>Hi Bill,
>
>thanks for answering - I'm using CMake to generate a VC7 project from a list
>${CTRLGUI_SRC} which contains like 60 files.
>When opening the project in VC7, the source files show up in the "Source
>Files"- and "Header Files"-Folder of the Solution Explorer in the same order
>they are listed in the ${CTRLGUI_SRC} list.
>There are QT_WRAPPER macros and other special handling involved for some
>files so its not possible to assemble the list alphabetically in the
>CMakeLists-file just by hand.
>Well to make a long story short it would be just more convenient to have the
>files in the "Solution Explorer"-folders sorted alphabetically.
>I guess i go ahead then and try to add a SORT command myself... cross your
>fingers for me ;-)
>
>Thanks again,
>
>Mike
>
>----- Original Message ----- 
>From: "William A. Hoffman" <billlist at nycap.rr.com>
>To: "Michael T. Wagner" <mtw at shared-reality.com>; <cmake at www.cmake.org>
>Sent: Friday, February 20, 2004 2:39 PM
>Subject: Re: [Cmake] howto sort a cmake list ?
>
>
>> I guess you could do it with a TRY_COMPILE and an EXEC_PROGRAM.
>> But, I do not think there is a way to sort a list in the cmake language
>> right now.   Just curious, why would you want to sort a list in a cmake
>file?
>>
>> -Bill
>>
>>
>> At 05:53 AM 2/20/2004, Michael T. Wagner wrote:
>> >Hi all,
>> >
>> >this might be a dumb question but I didnt figure out how to do it - I've
>set
>> >a list with SET (list blah dablah ..) and want to sort it alphabetically.
>> >So is there any SORT command in CMake for lists ?
>> >I tried to do a FOREACH loop with the list elements and compare them with
>IF
>> >(${var} STRLESS ${var}) but it didnt work with two variables.
>> >What am I missing ?
>> >
>> >Thanks alot for any answer,
>> >
>> >Mike
>> >
>> >
>> >
>> >
>> >
>> >_______________________________________________
>> >Cmake mailing list
>> >Cmake at www.cmake.org
>> >http://www.cmake.org/mailman/listinfo/cmake
>>
>> _______________________________________________
>> Cmake mailing list
>> Cmake at www.cmake.org
>> http://www.cmake.org/mailman/listinfo/cmake
>
>_______________________________________________
>Cmake mailing list
>Cmake at www.cmake.org
>http://www.cmake.org/mailman/listinfo/cmake