1 2 3 4 5 6
set(thelist "" NEW OLD) list(GET thelist 1 thevalue) if (NOT thevalue STREQUAL "OLD") message(SEND_ERROR "returned element '${thevalue}', but expected 'OLD'") endif()