project_options icon indicating copy to clipboard operation
project_options copied to clipboard

fix: support iterating list containing generator expressions that have semicolons

Open FeignClaims opened this issue 1 year ago • 0 comments

Add a function convert_genex_semicolons to convert semicolons inside generator expressions into $<SEMICOLON>. After this function, the list contains generator expressions can be properly iterated.

set(dirs "$<$<CONFIG:Debug>:dir1;dir2>" "$<$<CONFIG:Release>:dir3;dir4>")

convert_genex_semicolons("${dirs}" dirs)
# now dirs is "$<$<CONFIG:Debug>:dir1$<SEMICOLON>dir2>;$<$<CONFIG:Release>:dir3$<SEMICOLON>dir4>"

foreach(dir IN LISTS dirs)
  # element 0: "$<$<CONFIG:Debug>:dir1$<SEMICOLON>dir2>"
  # element 1: "$<$<CONFIG:Release>:dir3$<SEMICOLON>dir4>"
endforeach()

Close #205

FeignClaims avatar Feb 23 '24 07:02 FeignClaims