CMake list for string: simple semicolon replacement
I am confused with a very simple example. I have a standard list, so basically its string representation uses semicolons as separators. I want to replace it with another one:
set(L1 "A" "B" "C")
message("L1: ${L1}")
string(REPLACE ";" "<->" L2 ${L1})
message("L2: ${L2}")
this snippet prints:
L1: A;B;C
L2: ABC
and I don't understand why. Consistent with for some other SO answers, my string replacement seems to be valid. What am I doing wrong? Is there a way to store the value A<->B<->C
in my second variable?
Note. I am using CMake 3.7.2
+3
source to share
2 answers