5 ms·
CMake is entirely stringly-typed as well. Like many shells, arrays/lists are just space-separated strings.
by colejohnson66 2y ago
CMake is entirely stringly-typed as well. Like many shells, arrays/lists are just space-separated strings.
- mdaniel 2y agoPedantically that's not true, they're ';' delimited https://cmake.org/cmake/help/v3.31/command/list.html#:~:text=A%20list%20in%20cmake%20is%20a%20%3B%20separated%20group%20of%20strings https://cmake.org/cmake/help/v3.31/command/list.html#:~:text... The confusion comes from the fact that set() automatically coerces space-delimited items into a ;-delimited list set(ONE alpha;beta) set(TWO alpha beta) list(LENGTH ONE one_len) list(LENGTH TWO two_len) message(FATAL_ERROR "one <<${ONE}>> length ${one_len}\ntwo <<${TWO}>> length ${two_len}") emits one <<alpha;beta>> length 2 two <<alpha;beta>> length 2