list(POP_FRONT) always assigns first item to output vars
When storing the items popped from the front of a list with list(POP_FRONT)
, the value stored is always the first item in the original list. Minimal script demonstrating the problem (to be run with cmake -P
):
cmake_minimum_required(VERSION 3.15)
set(myList a b c)
list(POP_FRONT myList first second)
message("first = ${first}")
message("second = ${second}")
message("myList = ${myList}")
Expected output:
first = a
second = b
myList = c
Actual output:
first = a
second = a <----- this is the bug
myList = c