function(replaceAllSubs)
set(replaced )
set(tail )
math(EXPR tail "${ARGC}-1")
foreach( i RANGE 1 ${tail})
set(cur )
list(GET ARGV ${i} cur)
string(REPLACE "aa" "bb" rep ${cur})
list(APPEND replaced ${rep})
endforeach()
set(${ARGV0} ${replaced} PARENT_SCOPE)
endfunction()
set(replacedResultList )
# ARGV0 is the return result
replaceAllSubs(replacedResultList ${inputListOfString})
foreach(key ${replacedResultList})
message(STATUS "${key}\n")
endforeach()
标签:replacedResultList,set,sub,cur,replace,tail,replaced,string
From: https://www.cnblogs.com/Searchor/p/17282751.html