Ah, so CMAKE_CONFIGURE_DEPENDS follows the list expansion rules, then. Thanks!
What if I want a list with an unbalanced number of [ and ] in a given item? For example, how can I represent a list where the first item is [ and the second is ]?
I’ve seen those comments, yeah. Was holding out hope for some arcane, undocumented workaround.
What’s the purpose of this “feature”, anyway? I would understand if the brackets were stripped out and just functioned as a method of avoiding manually escaping the individual semicolons between them. I can’t think of a use case where you’d want a list item containing semicolons and surrounded by actual brackets.
EDIT: Answering my own question - tracked down the original commit responsible, and the answer is Windows registry keys, which are surrounded by [] and may contain ;.
It just occurred to me that there’s no way to end a list item in a \, either, unless the item is at the very end of the list (so, better make sure no one passes in a Windows directory path with a trailing backslash). Oh, what a headache this is…
Thanks for the pointer toward TO_CMAKE_PATH. That helps a bit. Of course, it’d be better if CMake lists behaved in a reasonable way in the first place.