@@ -75,26 +75,34 @@ if(ENV)
7575 # CMake treats ';' as a list separator. Since ENV values may legitimately
7676 # contain semicolons (e.g. PATH-like variables), we must escape them here
7777 # so they survive the upcoming list expansion in `foreach()`.
78+ message ("ENV : ${ENV} " )
7879 string (REPLACE ";" "\\ ;" _env "${ENV} " )
80+ message ("_env : ${_env} " )
7981
8082 # Deserialize the ENV string into a CMake list.
8183 # This is the inverse operation of ROOT_ADD_TEST, which serializes the list
8284 # by joining elements with '#'.
8385 string (REPLACE "#" ";" _env "${_env} " )
86+ message ("_env : ${_env} " )
8487
8588 foreach (pair ${_env} )
8689
8790 # During list expansion, CMake has already consumed any previous '\;'
8891 # escaping. Re-escape semicolons so the key=value split below treats the
8992 # value as a single string.
93+ message ("pair : ${pair} " )
9094 string (REPLACE ";" "\\ ;" pair "${pair} " )
95+ message ("pair : ${pair} " )
9196
9297 # Split KEY=VALUE into a 2-element CMake list: [KEY;VALUE]
9398 string (REGEX REPLACE "^([^=]+)=(.*)$" "\\ 1;\\ 2" pair "${pair} " )
99+ message ("pair : ${pair} " )
94100
95101 list (GET pair 0 var)
96102 list (GET pair 1 val)
97103
104+ message (" ${var} : ${val} " )
105+
98106 # As before, quoting is important here so the semicolons are not
99107 # interpreted as list separators.
100108 set (ENV{${var} } "${val} " )
0 commit comments