[CMake] baffled by function string value set up

hce jupiter.hce at gmail.com
Fri Jul 20 07:35:19 EDT 2012


Hi,

I am completely baffled by following results to get string values from a
function, please enlighten me what was wrong in following simplified
function? 

function(GetParameterDebug oa ob oc od)
    set(a "sa")
    set(b "sb")
    set(c "sc")
    set(d "sd")
    set(${oa} ${a} PARENT_SCOPE)
    set(${ob} ${b} PARENT_SCOPE)
    set(${oc} ${c} PARENT_SCOPE)
    set(${od} ${d} PARENT_SCOPE)
    message("## 1: a = .${a}. b = .${b}. c=.${c}. d=.${d}.")
    message("## 2: oa = .${oa}. ob = .${ob}. oc = .${oc}. od = .${od}.")
endfunction(GetParameterDebug)

GetParameterDebug(string_a, string_b, string_c, string_d)
message("## debug string_a = .${string_a}., string_b = .${string_b}.,
string_c = .${string_c}., string_d = .${string_d}.")

The result:
## 1: a = .sa. b = .sb. c=.sc. d=.sd.
## 2: oa = .string_a,. ob = .string_b,. oc = .string_c,. od = .string_d.
## debug string_a = .., string_b = .., string_c = .., string_d = .sd.


The about print out ##1 was good, the ##2 and ## debug were completely
wrong.

Thank you and appreciate explanation.









--
View this message in context: http://cmake.3232098.n2.nabble.com/baffled-by-function-string-value-set-up-tp7580942.html
Sent from the CMake mailing list archive at Nabble.com.


More information about the CMake mailing list