2 macro(serialize_lit_param output_var param value)
3 string(APPEND ${output_var} "config.${param} = ${value}\n")
6 macro(serialize_lit_string_param output_var param value)
7 # Ensure that all quotes in the value are escaped for a valid python string.
8 string(REPLACE "\"" "\\\"" _escaped_value "${value}")
9 string(APPEND ${output_var} "config.${param} = \"${_escaped_value}\"\n")
12 macro(serialize_lit_params_list output_var list)
13 foreach(param IN LISTS ${list})
14 string(FIND "${param}" "=" _eq_index)
15 string(SUBSTRING "${param}" 0 ${_eq_index} name)
16 string(SUBSTRING "${param}" ${_eq_index} -1 value)
17 string(SUBSTRING "${value}" 1 -1 value) # strip the leading =
18 serialize_lit_string_param("${output_var}" "${name}" "${value}")