What is the best way to join a list in CMake into a string?
By joining I mean convert SET(somelist \"a\" \"b\" \"c\\;c\") to \"a:b:c;c\" where the glue string (\":\") i
You can use the string REPLACE function:
function(JOIN VALUES GLUE OUTPUT) string (REPLACE ";" "${GLUE}" _TMP_STR "${VALUES}") set (${OUTPUT} "${_TMP_STR}" PARENT_SCOPE) endfunction() #USAGE: SET(somelist a b c) JOIN("${somelist}" ":" output) MESSAGE("${output}") # will output "a:b:c"