List in some cases ignores empty list items if they are at the begining of the list. Here is an example:
cmake_policy(SET CMP0007 NEW) # do not ignore empty list item in list command SET(text "1;;2;;;;3;4;") WHILE(${text}) list(GET text 0 str) list(REMOVE_AT text 0) MESSAGE(STATUS "-${str}-"). ENDWHILE(${ui_text}) running it we will get -- -1- -- -2- -- -3- empty lines are skipped but if we add dummy non-empty at the beginning of the list, and then remove second elements one by one, everything would work as expected: cmake_policy(SET CMP0007 NEW) # do not ignore empty list item in list command SET(text "1;;2;;;;3;4;") SET(text "dummy_line;${text}") WHILE(NOT text STREQUAL "dummy_line" ) list(GET text 1 str) list(REMOVE_AT text 1) MESSAGE(STATUS "-${str}-"). ENDWHILE(NOT text STREQUAL "dummy_line" ) we will get: -- -1- -- -- -- -2- -- -- -- -- -- -- -- -3- -- -4- -- -- $ cmake --version cmake version 2.6-patch 0 I think that is not nice behavior. If you consider it bug, I can officially report it to the bug tracker. PS, there is also problem with FOREACH with list with empty lines... I do not know wether it should be so or not... _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake