2015-09-17 23 views
6

Bir dizeyi cmake olarak değişken ad olarak yorumlamanın bir yolunu arıyorum.CMake dize olarak değişken yorumlayın

Verilen: unwrapping ait

set(MY_SECRET_VAR "foo") 

# later only the name of the variable is known. 
set(THE_NAME "MY_SECRET_VAR") 

# Now i'm looking for a way to get the value "foo" from the name 
# something like: 
set(THE_VALUE "${THE_NAME}") 

# THE_VALUE should be "foo" 

cevap

7

İkinci seviye:

set(THE_VALUE "${${THE_NAME}}")