blob: 8b3d87e7b80b508feb84981c028757a72da7ae3b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
# By using bash builtin expansion, we can avoid
# expensively spawing three sub-processes (bash, echo, sed).
foreach(dir IN LISTS SOURCE_DIRS)
file(READ "${dir}/configure" script)
string(REGEX REPLACE
"(\n[a-zA-Z0-9_]*)='`[\$]ECHO \"[\$]([^\"]*)\" \\| [\$]SED \"[\$]delay_single_quote_subst\"`'"
[[\1='${\2//\\'/\\'\\\\\\'\\'}']]
script "${script}"
)
string(REPLACE
[[ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in]]
[[ case "\${!var}" in]]
script "${script}"
)
file(WRITE "${dir}/configure" "${script}")
endforeach()
|