> -----Original Message-----
> From: Sylvain Benner [mailto:[EMAIL PROTECTED]
> Sent: 11 October 2007 16:16
> To: Josef Karthauser
> Cc: cmake@cmake.org
> Subject: Re: [CMake] Removing the first element from a list
> 
> 
> > How does one go about removing the first element of a list
> Have a look to the LIST command, you'll have everything you need.

Any idea why this works,

        MACRO(TEST)
        SET(Q ${ARGN})
        WHILE(${Q})
               # Get the command
               LIST(GET Q 1 CMD)
               LIST(REMOVE_AT Q 1)
               MESSAGE("Command was ${CMD}")
        ENDWHILE(Q)
        ENDMACRO(TEST)

        TEST(NOT A B NOT C D CLEAR)

But this doesn't?

        MACRO(SHIFT RESULT LISTVAR)
        LIST(GET LISTVAR 1 RESULT)
        LIST(REMOVE_AT LISTVAR 1)
        ENDMACRO(SHIFT)

        MACRO(TEST)
        SET(Q ${ARGN})
        WHILE(${Q})
                # Get the command
                SHIFT(CMD Q)
                MESSAGE("Command was ${CMD}")
        ENDWHILE(Q)
        ENDMACRO(TEST)

        TEST(NOT A B NOT C D CLEAR)

Joe
_______________________________________________
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to