I found "[" and "]" might have special meanings in a semicolon-separated list in CMake
. When I try this code in CMakeLists.txt
:
set(XX "a" "b" "[" "]")
message("${XX}")
foreach(x ${XX})
message("--> ${x}")
endforeach()
I expect the result:
a;b;[;]
--> a
--> b
--> [
--> ]
However I got this:
a;b;[;]
--> a
--> b
--> [;]
I didn't find any documentation for the usage of "[" and "]". Is it possible to escape these characters so that I can get the expected result? I am using CMake 2.8.12.2
. Thanks for any help :)